Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: how to remove everything before last slash in perl?

by Tux (Monsignor)
on Jun 23, 2012 at 22:58 UTC ( #978019=note: print w/ replies, xml ) Need Help??


in reply to Re: how to remove everything before last slash in perl?
in thread how to remove everything before last slash in perl?

More than one way?

my $filename = (split m{/} => $full_path)[-1];

I agree however that File::Basename is way better, as it also deals with filesystems other than Unix-like that use a forward slash.


Enjoy, Have FUN! H.Merijn


Comment on Re^2: how to remove everything before last slash in perl?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-11-23 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (128 votes), past polls