misterperl has asked for the wisdom of the Perl Monks concerning the following question:
print F "$0:$t\n";
SOMETIMES it prints:and other times the same exact statement prints:myprog.pl:2
/home/user/perlcode/myprog.pl:2
Which is unexpected, fairly annoying, and inconvenient , since later when I grep the file for $0, SOMETIMES the path is there, sometimes not. And which variety is used in the grep is also consequential, and indeterminate. Is there some other perlvar, or some context, where $0 would include the path, and sometimes not? Perl v5.16.3
Also, on other nodes (dev and qa) this code worked 100% - no paths. This all started when the code was copied to another CENTOS node.
TY Perl Dieties esp Damian!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $0 consistent!
by LanX (Saint) on Apr 13, 2022 at 13:47 UTC | |
by misterperl (Friar) on Apr 13, 2022 at 14:13 UTC | |
|
Re: $0 inconsistency?
by choroba (Cardinal) on Apr 13, 2022 at 17:08 UTC | |
by Perlbotics (Archbishop) on Apr 13, 2022 at 17:46 UTC | |
by mr_mischief (Monsignor) on Apr 13, 2022 at 18:34 UTC | |
by misterperl (Friar) on Apr 15, 2022 at 12:59 UTC | |
|
Re: $0 inconsistency?
by Perlbotics (Archbishop) on Apr 13, 2022 at 17:59 UTC | |
|
Re: $0 inconsistency? $0 doc
by Anonymous Monk on Apr 13, 2022 at 13:45 UTC | |
by LanX (Saint) on Apr 13, 2022 at 13:51 UTC | |
by Anonymous Monk on Apr 13, 2022 at 15:13 UTC | |
by misterperl (Friar) on Apr 15, 2022 at 13:02 UTC |