C
csimojoe
I have a customer that uploads images to the web server, and then a
perl script shows the images in a slideshow. The files are sometimes
uploaded as .jpg and other times in all caps as .JPG extensions.
The script works perfectly with the lowercase .jpg uploads, but won't
recognize the .JPG files. Customer wants the script to work with both.
Here are the segments of the script that deal with the extension:
#$ext
# Extension of the images(do not include the ".") Examples:
"gif","jpg",
etc.
$ext = 'jpg';
@names=grep(/\.$ext$/,readdir(DIR));
I've tried to add -i to the grep... no good.
Any help would be GREATLY appreciated. I'm obviously not good with
perl or scripts. Sorry.
-Joe
perl script shows the images in a slideshow. The files are sometimes
uploaded as .jpg and other times in all caps as .JPG extensions.
The script works perfectly with the lowercase .jpg uploads, but won't
recognize the .JPG files. Customer wants the script to work with both.
Here are the segments of the script that deal with the extension:
#$ext
# Extension of the images(do not include the ".") Examples:
"gif","jpg",
etc.
$ext = 'jpg';
@names=grep(/\.$ext$/,readdir(DIR));
I've tried to add -i to the grep... no good.
Any help would be GREATLY appreciated. I'm obviously not good with
perl or scripts. Sorry.
-Joe