File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -851,8 +851,10 @@ length of C<$0>. In the most extreme case it may be limited to the
851
851
space occupied by the original C<$0>.
852
852
853
853
Note for BSD users: setting C<$0> does not completely remove "perl"
854
- from the ps(1) output. For example, setting C<$0> to C<"foobar"> will
855
- result in C<"perl: foobar (perl)">. This is an operating system feature.
854
+ from the ps(1) output. For example, setting C<$0> to C<"foobar"> may
855
+ result in C<"perl: foobar (perl)"> (whether both the C<"perl: "> prefix
856
+ and the " (perl)" suffix are shown depends on your exact BSD variant
857
+ and version). This is an operating system feature, Perl cannot help it.
856
858
857
859
In multithreaded scripts Perl coordinates the threads so that any
858
860
thread may modify its copy of the C<$0> and the change becomes visible
Original file line number Diff line number Diff line change @@ -300,8 +300,11 @@ else {
300
300
};
301
301
my $ps = $mydollarzero -> (" x" );
302
302
ok(!$ps # we allow that something goes wrong with the ps command
303
- # FreeBSD cannot get rid of the trailing " (perl)".
304
- || $ps =~ / ^x\b / ,
303
+ || $ps eq ' x'
304
+ # FreeBSD cannot get rid of both the leading "perl :"
305
+ # and the trailing " (perl)": some FreeBSD versions
306
+ # can get rid of the first one.
307
+ || ($^O eq ' freebsd' && $ps =~ m / ^(?:perl: )? x (?:\( perl\) )?$ / )
305
308
' altering $0 is effective (testing with `ps`)' );
306
309
} else {
307
310
skip(" \$ 0 check only on Linux and FreeBSD" ) for 0, 1;
You can’t perform that action at this time.
0 commit comments