in reply to Using Image::Size
Rule #2 of coding is "Are you testing what you think you're testing?" Quick check would be to insert the following two lines right after your close(DIR):
You'd then notice that "../images/dir/name" is not part of the files elements, so when you call imgsize, it's not going to have the faintest idea what file you're referring to.use Data::Dumper; print Dumper(\@files);
This is actually a place where glob is great. Just convert your first three lines to:
and you can pretty much get rid of your if's.@files = glob '../images/dir/name/*.{jpg,JPG}';
Update: Rule #2a of coding is "Are you testing what you're posting?" <sigh> - added the Dumper function call as nedals points out.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Image::Size
by kmarshall (Novice) on Sep 24, 2005 at 01:31 UTC | |
by Tanktalus (Canon) on Sep 24, 2005 at 02:28 UTC | |
by kmarshall (Novice) on Sep 24, 2005 at 03:07 UTC | |
by Tanktalus (Canon) on Sep 24, 2005 at 15:04 UTC | |
by kmarshall (Novice) on Sep 24, 2005 at 16:37 UTC | |
by nedals (Deacon) on Sep 24, 2005 at 01:57 UTC |