Monday, May 24, 2010

How do I change default input in PERL - cgi.pm?

I'm having a problem with one of my scripts. Basically, I want cgi.pm to read and decode multipart/form-data from a file. Here's a demo of what I mean:





use CGI;


print "Content-type: text/html\n\n";





open STDIN,"%26lt;file.tmp";





my $query = new CGI;





print $query-%26gt;param;





#should print the encoded parameters from file.tmp, only it doesn't





Thank you for your time.

How do I change default input in PERL - cgi.pm?
that looks about right... what's in file.tmp??





when debugging cgi I remember CGI asking for params 1 at a time. Don't remember if that was the default behavior when running a cgi in a shell (not in the server) or maybe It was triggered with an -option





you can get better debugging if you build a tiny form page and hit your cgi with ACTUAL valid data in the correct format that CGI wants!








and for print $query-%26gt;param;


i'd slip in a loop to show the params and their values!


No comments:

Post a Comment