in reply to Re: Quick Regex question
in thread Quick Regex question
So if File::Basename is working properly, perhaps your input is messed up somehow? Are you reading your filenames from a file perhaps and forgetting to chop off the newline?(fastolfe) gemina:~$ cat test use File::Basename; fileparse_set_fstype('MSWin32'); # Because I'm on Unix while (<DATA>) { chomp; printf("%20s %s\n", $_, basename($_)); } __DATA__ a:\pic3.jpg a:\some\dir\pic.jpg a:\some\other\pic \blah\pic. a:\pic a:pic.jpg a:\pic3. (fastolfe) gemina:~$ perl test a:\pic3.jpg pic3.jpg a:\some\dir\pic.jpg pic.jpg a:\some\other\pic pic \blah\pic. pic. a:\pic pic a:pic.jpg pic.jpg a:\pic3. pic3.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Quick Regex question
by Stamp_Guy (Monk) on Jan 14, 2001 at 07:36 UTC | |
by tilly (Archbishop) on Jan 14, 2001 at 07:44 UTC | |
by Stamp_Guy (Monk) on Jan 14, 2001 at 07:59 UTC | |
by tilly (Archbishop) on Jan 14, 2001 at 09:00 UTC | |
by Stamp_Guy (Monk) on Jan 14, 2001 at 09:44 UTC | |
| |
by Fastolfe (Vicar) on Jan 14, 2001 at 08:31 UTC | |
by merlyn (Sage) on Jan 14, 2001 at 08:58 UTC | |
| |
by Stamp_Guy (Monk) on Jan 14, 2001 at 08:08 UTC | |
by I0 (Priest) on Jan 14, 2001 at 08:07 UTC | |
by Stamp_Guy (Monk) on Jan 14, 2001 at 09:53 UTC | |
by Fastolfe (Vicar) on Jan 14, 2001 at 20:41 UTC |