Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 rifling through the Monastery: (13)
As of 2015-09-01 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (15 votes), past polls