jae_63 has asked for the wisdom of the Perl Monks concerning the following question:
perl -d:ptkdb foo.cgi "PARAM1=val1&PARAM2=val2"where PARAM1 and PARAM2 are fields in the CGI form which invokes foo.cgi when the user presses the Submit button.
Now I would like to do the same thing, but two of the arguments are uploaded files, i.e. there's an HTML form which looks like:
and on the CGI side we have code such as:<FORM ENCTYPE="multipart/form-data" ACTION="./foo.cgi" METHOD="POST"> Protease: <SELECT NAME="PARAM1"> <OPTION SELECTED>trypsin</OPTION> <OPTION>pepsin</OPTION> <OPTION>none</OPTION> </SELECT><br> Sort output by: <SELECT NAME="PARAM2"> <OPTION VALUE="mw" SELECTED>Molecular weight</OPTION> <OPTION VALUE="pos">Position</OPTION> </SELECT><br> <p> Please select an OBSERVED spectrum file to upload: <BR> <INPUT TYP +E="FILE" NAME="MEASURED_SPECTRUM"> <p> <p> Please select a protein sequence file to upload: <BR> <INPUT TYPE= +"FILE" NAME="SEQUENCE"> <p> <INPUT TYPE="submit"> </FORM>
Question: how can I invoke Perl from the command-line so that these file-handles are properly initialized?my $q = new CGI; $fh1 = $q->param('MEASURED_SPECTRUM'); # these are really file-handles $fh2 = $q->param('SEQUENCE'); ... while (<$fh1>) { ... } ... while (<$fh2>) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI.pm debugging with TYPE=FILE & ENCTYPE="multipart/form-data"
by Joost (Canon) on Feb 13, 2008 at 21:25 UTC | |
|
Re: CGI.pm debugging with TYPE=FILE & ENCTYPE="multipart/form-data"
by pc88mxer (Vicar) on Feb 13, 2008 at 20:57 UTC | |
|
Re: CGI.pm debugging with TYPE=FILE & ENCTYPE="multipart/form-data"
by Anonymous Monk on Feb 14, 2008 at 07:39 UTC | |
|
Re: CGI.pm debugging with TYPE=FILE & ENCTYPE="multipart/form-data"
by pc88mxer (Vicar) on Feb 14, 2008 at 16:10 UTC |