Hi, all. I've been wrestling with this problem for a few hours now, and it seems to be a little beyond my reach. $0 seems not to work for me in Perl 5.8.0, whereas it works fine in an identically configured Perl 5.6.(0|1):
[ strider@isengard[pts/3] (16:07) ~/old-homedir ]
% perl5.8.0 -e '$0 = "blork"; system( "ps -auxw" ); ' | grep blork
strider 2561 0.0 0.4 2632 1036 pts/3 S 16:07 0:00 perl5.8
+.0 -e $0 = "blork"; system( "ps -auxw" );
strider 2563 0.0 0.1 1400 436 pts/3 S 16:07 0:00 grep bl
+ork
[ strider@isengard[pts/3] (16:07) ~/old-homedir ]
% perl5.6.1 -e '$0 = "blork"; system( "ps -auxw" ); ' | grep blork
strider 2564 0.0 0.3 2448 968 pts/3 S 16:07 0:00 blork
strider 2566 0.0 0.1 1400 436 pts/3 S 16:07 0:00 grep bl
+ork
So we know the platform supports setting the program name with $0; I've even tested with a C program, which worked fine (and was compiled with the same compiler used for 5.8.0). The only difference seems to be the Perl version. perlvar and perlfaq8 both agree that 5.8.0 still supports $0.
Does anyone have any ideas?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.