Mayhem50 has asked for the wisdom of the Perl Monks concerning the following question:
Anyway when I use 'use strict' on the CGI below I get errors about the '$IMPUT' variable and that I should declare it. I’ve tried putting my in front of it when I pass the values in into it and even creating a empty version at the start of the script with ‘My $INPUT = “”;’ but I just can’t figure it out. I’m sure it’s real simple but I’ve spent a day looking for the answer with no luck. Thanks in advance guys.
#!c:/Perl/bin/Perl.exe -w use strict; use CGI; print "Content-type: text/html\r\n\r\n"; # PDF 2 JPEG CGI my $INPUT = (); &DecodeInURL(); my $PDF2JPGEXE = 'C:\_TestSite\PDF2JPG\bin\pdf2jpeg.exe'; my $PDFFile = $INPUT{"file"}; print "**$PDFFile<br>"; my $output = 'Out_Temp\TempPDF%3.3d.jpg'; my $PDF2JPG_OutPut = system("$PDF2JPGEXE -w -d 90 -q 80 -s 240 300 -f + $PDFFile $output"); print "<p>Output: $PDF2JPG_OutPut"; sub DecodeInURL { my $Decoded = $ENV{'QUERY_STRING'}; #Get Method $Decoded =~ s/%([\a-fA-F0-9][a-fA-F0-9])/pack('C', hex($1))/eg; print "$Decoded\n"; my @INPUTVars = split /\&/ , $Decoded; foreach my $pair (@INPUTVars) { if ($pair=~m/([^=]+)=(.*)/) { my $field = $1; my $Value = $2; $Value =~ s/\+/ /g; $INPUT{$field}=$Value; return $INPUT; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use Strict & subs
by duff (Parson) on Dec 30, 2004 at 05:08 UTC | |
|
Re: Use Strict & subs
by Errto (Vicar) on Dec 30, 2004 at 05:40 UTC | |
by jbrugger (Parson) on Dec 30, 2004 at 07:23 UTC | |
by dragonchild (Archbishop) on Dec 30, 2004 at 13:41 UTC | |
by davorg (Chancellor) on Jan 02, 2005 at 16:48 UTC | |
|
Re: Use Strict & subs
by Mayhem50 (Novice) on Dec 30, 2004 at 05:30 UTC | |
|
Re: Use Strict & subs
by swaroop.m (Monk) on Dec 30, 2004 at 14:44 UTC | |
|
Re: Use Strict & subs
by sasikumar (Monk) on Dec 30, 2004 at 05:51 UTC |