From 54bfe034ba642318cf2c7d0b37579f30adef144a Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sun, 29 Jun 2003 15:41:05 +0000 Subject: The joy of $0. Undoing the #16399 makes Andreas' tests (see [perl #22811]) pass (yes, padding with space instead of nul makes no sense, but that seems to work, maybe Linux does some deep magic in ps(1)?); moving the PL_origalen computation earlier makes also the threaded-first case fully pass. But in general modifying the argv[] is very non-portable. (e.g. in Tru64 it seems to be limited to the size of the original argv[0] since the argv[] are not contiguous?) Everybody should just have setproctitle(). p4raw-id: //depot/perl@19884 --- pod/perlvar.pod | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'pod/perlvar.pod') diff --git a/pod/perlvar.pod b/pod/perlvar.pod index ad791dd71b..7667f1d75d 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -838,16 +838,17 @@ and C<$)> can be swapped only on machines supporting setregid(). =item $0 -Contains the name of the program being executed. On some operating -systems assigning to C<$0> modifies the argument area that the B -program sees. This is more useful as a way of indicating the current -program state than it is for hiding the program you're running. -(Mnemonic: same as B and B.) +Contains the name of the program being executed. On some (read: not +all) operating systems assigning to C<$0> modifies the argument area +that the B program sees. Also note that depending on the platform, +the maximum length of C<$0> may be limited to the space occupied by +the original C<$0>. This is more useful as a way of indicating the +current program state than it is for hiding the program you're +running. (Mnemonic: same as B and B.) Note for BSD users: setting C<$0> does not completely remove "perl" from the ps(1) output. For example, setting C<$0> to C<"foobar"> will -result in C<"perl: foobar (perl)">. This is an operating system -feature. +result in C<"perl: foobar (perl)">. This is an operating system feature. In multithreaded scripts Perl coordinates the threads so that any thread may modify its copy of the C<$0> and the change becomes visible -- cgit v1.2.1