Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 about the Monastery: (6)
As of 2014-12-25 10:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls