Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

( #81914=categorized answer: print w/ replies, xml ) Need Help??

Q&A > strings > How do I split a string containing path+filename 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

Comment on Answer: How do I split a string containing path+filename
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2014-10-01 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (17 votes), past polls