on 07/09/2001 03:16 PM, Morbus Iff at [EMAIL PROTECTED] wrote: >> $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"; > > I was trying to recall what I'd done earlier to do something similar.. guess I mis-remembered :) thanks for the heads-up :) -- Scott R. Godin | e-mail : [EMAIL PROTECTED] Laughing Dragon Services | web : http://www.webdragon.net/
- [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