perl Image::size function

Hi, How to use Image::size function ? because I want to list all image thatare less than size pixels in horizontal resolution. so here is my code :

#!/usr/bin/perl -w

use Image::Size;
use constant GIVEN_WIDTH = '100';
my @filtered_images = grep { my @d = imgsize( $_ ); $d[0] < GIVEN_WIDTH } @images;

but it not really working, can you plz help

Thank

What does "but it not really working" mean? What error message do you get (if any)? Did you install the Image::Size module?

Can't locate Image/Size.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at test.pl line 3.

BEGIN failed--compilation aborted at test.pl line 3.

yes I have install the extention

Can you put the lines

use strict;
use warnings;
use diagnostics;

before the use Image::Size; line, and post the output here (using [CODE] tags)?

Can't locate Image/Size.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at test.pl line 7.
BEGIN failed--compilation aborted at test.pl line 7 (#1)
    (F) You said to do (or require, or use) a file that couldn't be
    found. Perl looks for the file in all the locations mentioned in @INC,
    unless the file name included the full path to the file.  Perhaps you
    need to set the PERL5LIB or PERL5OPT environment variable to say where
    the extra library is, or maybe the script needs to add the library name
    to @INC.  Or maybe you just misspelled the name of the file.  See
    perlfunc/require and lib.
    
Uncaught exception from user code:
	Can't locate Image/Size.pm in @INC (@INC contains: /Library/Perl/5.12/darwin-thread-multi-2level /Library/Perl/5.12 /Network/Library/Perl/5.12/darwin-thread-multi-2level /Network/Library/Perl/5.12 /Library/Perl/Updates/5.12.3 /System/Library/Perl/5.12/darwin-thread-multi-2level /System/Library/Perl/5.12 /System/Library/Perl/Extras/5.12/darwin-thread-multi-2level /System/Library/Perl/Extras/5.12 .) at test.pl line 7.
BEGIN failed--compilation aborted at test.pl line 7.
 at test.pl line 7

Fail again

Those lines weren't meant to solve the problem, but to find out what the problem really is. And in this case, as the error messages are quite clear, it can't find the module anywhere in it's include path. How did you install the module (as exact as possible please)?

am using mac os X and download imageMagic binary release for mac os x lion and follow install instruction on web the function such as display, identify working very well

See, you never installed Image::Size, as it's not part of ImageMagick. You'll have to install it separately, using the CPAN module, eg cpan -i 'Image::Size'

is there possible way to list all image that are less than size pixels in horizontal resolution
without image::size