>
> ok, i have cleaned up the code, and fixed all of the mistakes
> that i can
> find, but i still can't get this tying to compile and run.
> and, my code
> surely isn't written stout enough to handle a 'use strict'.
> if someone
> could tell me what i am STILL doing wrong i'd appreciate it. The Code:
>
> #!/usr/bin/perl
>
> use warnings;
> # use strict;
> use File::Find;
> use File::Remove qw(remove);
> use Image::Info qw(image_info);
> use File::Scan;
>
> # File::Find wanted function
> sub wanted;
>
> # variables
> our ( $file, $dir );
> *file = *File::Find::name;
> *dir = *File::Find::dir;
>
>
> print "Where are the pictures/?";
> chomp( my $indir = <STDIN> );
>
> File::Find::find(\&wanted, '$indir');
> exit;
>
> sub wanted {
> unless ($file =~ /\.jpg\z/ or
> $file =~ /\.tif\z/ or
> $file =~ /\.bmp\z/ or
> $file =~ /\.png\z/ ) { #
> delete every file exept listed image types.
> remove $file;
> }
> else {
> my $info = image_info(\$file);
> # the attributes of the image file
> $type = $info->(file_ext);
> # three letter image type
> $w = $info->(width);
> # pixel width
> $h = $info->(height);
> # pixel height
> $color = $info->(color_type) # color type
Your errors are talking about unquoted width and height
Try quoting them, $info->('width') etc
This may take care of the other synax errors also if not ::
Also always look at the line number and see if you can find anything screwy about it
or the context.
Dan M
> # delete small images
> if( ($w < 200 and $h < 400) or ($w < 400 and $h
> < 200) ) {
> remove $file;
> }
> # delete images that try to be a different type from what they say
> if ($type ne 'bmp' or
> $type ne 'jpg' or
> $type ne 'png' or
> $type ne 'tif') {
> remove $file;
> }
> # delete all gray scale images
> if ($color ne 'Gray' or
> $color ne'GrayA') {
> remove $file;
> }
> # check images for viruses
> if ($scanres->scan(\$file) ) {
> if( $scanres->suspicious) {
> print "$file looks like it has
> a virus, delete/? /(Y//N/)";
> remove $file if <STDIN> =~ /y|Y/;
> }
> }
> }
> }
>
>
>
> ..... and the errors:
>
> Unquoted string "width" may clash with future reserved word at
> ./bigimg2.pl line 35.
> Unquoted string "height" may clash with future reserved word at
> ./bigimg2.pl line 36.
> syntax error at ./bigimg2.pl line 39, near ") {"
> syntax error at ./bigimg2.pl line 62, near "}"
> Execution of ./bigimg2.pl aborted due to compilation errors.
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]