in reply to Re: Interesting line which I read from Monk's snippets
in thread Interesting line which I read from Monk's snippets
I used to use a regex substitution instead, and my fingers still "remember" the sequence: (my $iam = $0) =~ s,.*/,,;use File::Basename; my $iam = basename $0;
But when I started coding in Perl for Windows in addition to (Li|U)n[ui]x, it was unwieldy to use a regex which accounted for all the different pathname symbols. Someone told me about the File::Basename method, and I've used it ever since; it's easier to remember, easier to type, and part of the standard Perl distro on both systems.
|
---|