No such thing as a small change | |
PerlMonks |
Parsing a filenameby rooneyl (Sexton) |
on Jul 07, 2008 at 17:34 UTC ( [id://696049]=perlquestion: print w/replies, xml ) | Need Help?? |
rooneyl has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I know this subject has been covered,but I don't seem to get it. I have got a cgi script that uploads a file. I am using File::Basename to split the path to extract just the file name and extension. it works fine with Unix path separators, but I can not get it to work when dealing with a windows path. It strips out the path separators, but doesn't give the filename. If I upload a file called C:\Documents and Settings\Ryan\My Documents\sample.txt it gives me the full path minus the path separators.
The output for Unix is sample.txt. The output for windows is C:Documents and SettingsMy Documentssample.txt. Thank you for any help.
Back to
Seekers of Perl Wisdom
|
|