Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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
Replies are listed 'Best First'.
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 pondering the Monastery: (8)
As of 2015-07-31 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls