[Clipart] Fix for file extension issue
Bryce Harrington
bryce at bryceharrington.com
Fri Jul 2 00:19:11 PDT 2004
Hey, I figured out the problem with the file extensions.
I was calling file parse like this:
my ($fn,$dir,$ext) = fileparse($filename, '\..*?');
which basically takes everything up to the first dot and calls that the
filename, and everything after the first dot as the extension. Which
works fine for things like foo.svg, or (arguably) foo.tar.gz, but fails
horribly on things like foo-1.2.3.svg.
A better regexp appears to be:
my ($fn,$dir,$ext) = fileparse($filename, qr{\.[^\.]*?});
so I'm switching to that (unless anyone has an idea for something
better?
Bryce
More information about the clipart
mailing list