good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: lying about program nameby hippo (Bishop) |
on Jun 14, 2018 at 10:47 UTC ( [id://1216619]=note: print w/replies, xml ) | Need Help?? |
Typos aside, it is your understanding of the name change which does not tally. It is the name for the O/S which is being changed. Demo:
Running this I see:
So the name in the O/S has changed to 'bar' but within the script, $0 is still foo.pl since that is the file which perl is executing. Additionally, if you call system ('./foo.pl') the O/S uses the hashbang line to re-exec perl with the script as argument (as in the initial invocation in my run above), so your aliasing there would have no effect even at the O/S level.
In Section
Seekers of Perl Wisdom
|
|