Hi list,<div><br></div><div>I having been having some quirky behaviour when assigning $0... </div><div>For me this turned out to be as a result from this:</div><div><br></div><div>$0 = abs_path(dirname($0))."/".basename($0);</div>


<div><br></div><div>ie: make the process name (as shown in top/ps, be the name of the script - instead of the perl binary.</div><div>Which worked well when running "pidof <a href="http://whatever.pl" target="_blank">whatever.pl</a>", "ps auxww | grep <a href="http://whatever.pl" target="_blank">whatever.pl</a>", but not so much for "killall <a href="http://whatever.pl" target="_blank">whatever.pl</a>".</div>


<div><br></div><div>Some Googling has turned up the problem/cause:</div><div><div><a href="http://blogs.perl.org/users/aevar_arnfjor_bjarmason/2010/03/what-happens-when-you-assign-to-0.html" target="_blank">http://blogs.perl.org/users/aevar_arnfjor_bjarmason/2010/03/what-happens-when-you-assign-to-0.html</a></div>


<div><br></div><div>perl version is: v5.14.2</div><br></div><div><br></div><div>So I run the example shown -> which shows that the patch is applied.  Upon further investigation, I think the implementation could be refined, ie: in my code above, only the first 16 characters of string are chomped, thus leaving the program title with part of the the basepath of the script. In my case I worked around it using Sys::Prtcl->prctl_name($BASENAME),</div>

<div><br></div><div><br>The suggested change to this enhancement would be, if $0 points at a script, then change $0 assignment so that Perl grok's the rightmost part of the path. ie: leave $0 as-is, but modify this patch as so.</div>

<div><br></div><div>Thoughts?</div><div>Mathew</div>