Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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 imbibing at the Monastery: (8)
As of 2017-07-28 07:42 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (424 votes). Check out past polls.