Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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
[ambrus]: soonix, nysus: does it print a warning, like that you have to use a title of more than one word? the submit button doesn't show up until you add a title that clears that warning.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-12-15 09:56 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (426 votes). Check out past polls.