slipwalker has asked for the wisdom of the Perl Monks concerning the following question:
this script outputs:$ cat ps_info.pl #!/usr/bin/perl @a = ( "one", "two", "three", "four", "five" ); for (1..50) { print $0 . "," .$a[$c%5]."\n"; $0 = $a[$c%5]; $c++; sleep 2; } exit;
showing that the "$0" is being assigned different values, although, the "ps xww" does not show any difference, it sits there like this the whole time the script runs:$ ./ps_info.pl ./ps_info.pl,one one,two two,three three,four four,five five,one one,two two,three three,four four,five five,one one,two two,three
could you monks show me the light ?... what's wrong ? ( this is a Slackware Linux, kernel 2.4.21, perl 5.8.0 )5578 pts/5 S 0:00 /usr/bin/perl ./ps_info.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (perlvar) changing program name
by ysth (Canon) on Sep 12, 2004 at 03:39 UTC | |
|
Re: (perlvar) changing program name
by ccn (Vicar) on Sep 11, 2004 at 20:17 UTC | |
|
Re: (perlvar) changing program name
by sintadil (Pilgrim) on Sep 11, 2004 at 21:24 UTC | |
by steves (Curate) on Sep 11, 2004 at 21:59 UTC | |
by slipwalker (Acolyte) on Sep 11, 2004 at 22:43 UTC | |
by slipwalker (Acolyte) on Sep 11, 2004 at 22:53 UTC | |
by shenme (Priest) on Sep 12, 2004 at 00:44 UTC | |
by slipwalker (Acolyte) on Sep 11, 2004 at 22:38 UTC | |
by sintadil (Pilgrim) on Sep 11, 2004 at 23:01 UTC | |
|
Re: (perlvar) changing program name
by theorbtwo (Prior) on Sep 11, 2004 at 20:21 UTC | |
by slipwalker (Acolyte) on Sep 11, 2004 at 21:20 UTC |