Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: Interesting line which I read from Monk's snippets

by liverpole (Monsignor)
on Feb 03, 2006 at 12:30 UTC ( #527610=note: print w/replies, xml ) Need Help??

in reply to Re: Interesting line which I read from Monk's snippets
in thread Interesting line which I read from Monk's snippets

An easier way to get rid of the path is:
use File::Basename; my $iam = basename $0;
I used to use a regex substitution instead, and my fingers still "remember" the sequence: (my $iam = $0) =~ s,.*/,,;

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.

@ARGV=split//,"/:L"; map{print substr crypt($_,ord pop),2,3}qw"PerlyouC READPIPE provides"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://527610]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-06-21 12:45 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.