Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Binding Question

by mkmcconn (Chaplain)
on Jul 24, 2002 at 14:49 UTC ( #184865=note: print w/replies, xml ) Need Help??


in reply to Binding Question

That's an icky and unreliable way to get the filename from a path (my repentance for using it in the past is showing).

File::Basename, File::Spec and URI::file are more portable.

But, for another quicky that may or may not be more legible (it's a common idiom), this will also work for *nix and MS paths:

my ($fname) = $fullpath =~ m/([^\\|\/]+)$/;

mkmcconn
update: modified my tone and added a module

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2023-01-29 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?