Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: file name parsing to get the original file name

by rthawkcom (Novice)
on Jun 22, 2011 at 15:54 UTC ( #910922=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: file name parsing to get the original file name
in thread file name parsing to get the original file name

Wouldn't it be easier just to do:

$path=~/.*\/(.*)$/;$name=$1;

Basically nuke everything in the way and grab what's left??


Comment on Re^3: file name parsing to get the original file name
Re^4: file name parsing to get the original file name
by MarkM (Curate) on Dec 13, 2012 at 23:55 UTC
    The check:
    $path=~/.*\/(.*)$/;$name=$1; 
    
    Doesn't take into account that the path might *not* have a directory component...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://910922]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-07-25 10:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls