Re: Problem with Image::Info



Gary wrote:

#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
use Image::Info qw(image_info dim);

my $Photo = param('photo');
my $info = image_info("$Photo");

print header;
print start_html(-title=>'My Photos',  -bgcolor=>'#FFDEAD');

if (%info){
print "Good <br> \n";
}

print "<img SRC=\"$Photo\"/>",
print end_html;


$ perl tmp119.pl
Global symbol "%info" requires explicit package name at tmp119.pl line 12.
Execution of tmp119.pl aborted due to compilation errors.


I assume $info is a reference to a hash, in which case you need to read
perldoc perlref


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
.



Relevant Pages

  • use of our variable causes compilation errors
    ... Use of reserved word "our" is deprecated at dfw.pl line 22. ... Global symbol "$ErrorMessage" requires explicit package name at dfw.pl ... because the system default perl executable was in v5.005_03, ...
    (comp.lang.perl.misc)
  • Re: time and place of satellite coincidence
    ... use strict; ... C:\MinGW\source> perl index6.pl ... Global symbol "$tag" requires explicit package name at index6.pl line 30. ...
    (comp.lang.perl.misc)
  • Re: The $a have any special meanning ?
    ... use strict; ... the perl does not return error (Global symbol "$a" requires explicit package name...) ...
    (comp.lang.perl.misc)
  • Re: Use Strict, Perl 5.10 and Global Symbol requires explicit package name
    ... Use Strict, Perl 5.10 and Global Symbol requires explicit package name ... Why does, Line a throw a compiler error, "Global Symbol @dates requires explicit package name" while Line b throws the same error if I do just the opposite. ...
    (perl.beginners)
  • Re: Basic CGI.pm question
    ... Here you declare $elements as a scalar. ... C:\Home> perl -c t4.pl ... Global symbol "%elements" requires explicit package name at t4.pl line ...
    (comp.lang.perl.misc)