> $f =~ m/:(.*)$/ ? print "$1\n" : print "$f\n";
This will fail if you're more than one directory deep, ie, it'll work fine
on "HD:filename.xml", but will fail on "HD:Directory:filename.xml". In the
first case, it will properly return "filename.xml", in the second case, it
will return "Directory:filename.xml".
This small modification will fix that:
$f =~ m/:([^:]$.*)$/ ? print "$1\n" : print "$f\n";
--
Morbus Iff ( .sig on other machine. )
http://www.disobey.com/ && http://www.gamegrene.com/
"where's there's a will, there's a morbus ready to collect!"
- [MacPerl] how to get just the file name from full path Katherine Richmond
- Re: [MacPerl] how to get just the file name from f... Morbus Iff
- Re: [MacPerl] how to get just the file name from f... Todd Richmond
- Re: [MacPerl] how to get just the file name from f... Scott R. Godin
- Re: [MacPerl] how to get just the file name from f... Morbus Iff
- Re: [MacPerl] how to get just the file name fr... Scott R. Godin
- Re: [MacPerl] how to get just the file name from f... Katherine Richmond
- Re: [MacPerl] how to get just the file name from f... John W Baxter
- Re: [MacPerl] how to get just the file name fr... Ronald J Kimball
- Re: [MacPerl] how to get just the file name from f... John W Baxter
- Re: [MacPerl] how to get just the file name from f... Bruce Van Allen
- Re: [MacPerl] how to get just the file name from f... John W Baxter
- Re: [MacPerl] how to get just the file name fr... Bruce Van Allen
