Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Answer: How do I split a string containing path+filename

by tachyon (Chancellor)
on May 21, 2001 at 08:50 UTC ( #81914=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > How do I split a string containing path+filename - Answer contributed by tachyon

Quick and dirty regex answer (for Unix or DOS): ($b,$c) = $a =~ m|^(.*[/\\])([^/\\]+?)$|; I agree with grinder that your var names are obfu, which has its place, but usually we choose descriptive names like $p and $f or even $pathname and $filename ;-) tachyon

Log In?

What's my password?
Create A New User
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-02-21 17:49 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (314 votes). Check out past polls.