MysticFallout
Technical User
hi, i just uploaded Image::Info to my lib dir (not the regular dirs in @INC). my server doesnt have this module. and i try to run a simple script, but i get this error:
Undefined subroutine &main::image_info called at img.cgi line 17.
not sure why either. (ive never done this, always used installed modules). my script is below. comments on my horrible coding is welcome
lol
Undefined subroutine &main::image_info called at img.cgi line 17.
not sure why either. (ive never done this, always used installed modules). my script is below. comments on my horrible coding is welcome
Code:
#!/usr/bin/perl -w
BEGIN {
$| = 1;
open (STDERR, ">&STDOUT");
print "Content-type: text/plain\n\n";
}
require '/home/path/to/the/module/scripts/lib/Image/Info.pm';
use strict;
use CGI qw/:all/;
my $img_url = param('img_url') || "paper-04.jpg";
my $img = image_info($img_url);
my ($img_height, $img_width) = dim($img);
my $img_ext = $img->{file_ext};
my $nl = "\n\r";
print "Height: $img_height" . $nl;
print "Width: $img_width" . $nl;
print "File Extension: $img_ext";
exit(0);