Since you're not really using Perl to do anything but arrange the various *nix programs, why not use a shell script instead? It would be simpler, shorter, and wouldn't involve spawning an unnecessary interpreter.
#!/bin/bash
for image in *.{gif,bmp,jpg,wmf,jpeg,png}
do
size=`/usr/bin/identify $image`
...
[do whatever with "$size" here]
...
convert -geometry 800x600 $image ${image/./-l.}
convert -geometry 80x60 $image ${image/./-s.}
done
...and so on. This may be just a personal quirk of mine, but I find shell scripts (or batch files) coerced into another language (whatever it happens to be) gratingly pointless.
Update: Incidentally, it fails in Linux.
ben@Tyr:/tmp/Sorayama$ ../thumbnail
hajime1.jpg
hajime10.jpg
hajime2.jpg
hajime3.jpg
hajime4.jpg
hajime5.jpg
hajime6.jpg
hajime7.jpg
hajime8.jpgconverting hajime1.jpg ...
convert: invalid argument for option `hajime1-l.jpgxhajime1.jpg!': -re
+size.
convert: invalid argument for option `hajime1-s.jpgxhajime1.jpg!': -re
+size.
converting hajime10.jpg ...
converting hajime2.jpg ...
convert: invalid argument for option `hajime2-l.jpgxhajime2.jpg!': -re
+size.
convert: invalid argument for option `hajime2-s.jpgxhajime2.jpg!': -re
+size.
converting hajime3.jpg ...
convert: invalid argument for option `hajime3-l.jpgxhajime3.jpg!': -re
+size.
convert: invalid argument for option `hajime3-s.jpgxhajime3.jpg!': -re
+size.
converting hajime4.jpg ...
convert: invalid argument for option `hajime4-l.jpgxhajime4.jpg!': -re
+size.
convert: invalid argument for option `hajime4-s.jpgxhajime4.jpg!': -re
+size.
converting hajime5.jpg ...
convert: invalid argument for option `hajime5-l.jpgxhajime5.jpg!': -re
+size.
convert: invalid argument for option `hajime5-s.jpgxhajime5.jpg!': -re
+size.
converting hajime6.jpg ...
convert: invalid argument for option `hajime6-l.jpgxhajime6.jpg!': -re
+size.
convert: invalid argument for option `hajime6-s.jpgxhajime6.jpg!': -re
+size.
converting hajime7.jpg ...
converting hajime8.jpg ...
convert: invalid argument for option `hajime8-l.jpgxhajime8.jpg!': -re
+size.
convert: invalid argument for option `hajime8-s.jpgxhajime8.jpg!': -re
+size.
--
Human history becomes more and more a race between education and catastrophe. -- HG Wells