Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by Tux (Abbot)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978019]
help
Chatterbox?
[Corion]: A good daystart to everybody ;)
[Discipulus]: good morning Corion
[haukex]: Good morning!

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2017-02-28 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (398 votes). Check out past polls.