Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
XP is just a number
 
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 scrutinizing the Monastery: (5)
As of 2013-05-24 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (495 votes), past polls