Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Answer: How do I extract a file name from a path string

by vaevictus (Pilgrim)
on Oct 06, 2000 at 18:34 UTC ( #35582=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > How do I extract a file name from a path string - Answer contributed by vaevictus

open FILES, "dir /b /aa /s |" or die; while ( <FILES> ) { my( $dir, $file ) = /(.+)\\(.+)/; defined $file or next; # no path separator print "$dir => $file\n"; } close FILES;

Log In?

What's my password?
Create A New User
[Corion]: Nice to see that the kids have some understanding of important things that happen and the appropriate behaviour :)
[marto]: at times mine surprise me with this behavior :)
[Corion]: I mean, in a way it would be nicer+easier if they always where that obedient, but it's comforting to see that they are when it matters, at least for now ;)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2016-12-08 09:28 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (138 votes). Check out past polls.