If you're using "use CGI;" (you are, right?) it's as easy as invoking your CGI script from the command line with the parameters enumerated as 'key="value"' on the command line. I don't think it's quite that simple if you're rolling your own CGI input parser (you aren't, right?) ;)
Check out the POD for CGI.pm; it describes pretty clearly how to input key/val parameters from the command line for the purpose of debugging scripts. Nice little feature.
Dave
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein
| [reply] [d/l] [select] |
Hi Dave,
actually I own my own server and want to go to the command line and type perl myscript.pl {pass form variable}
-Paul
| [reply] |
actually I own my own server and want to go to the command line and type perl myscript.pl {pass form variable}
Yes, and since your original question mentioned passing form data from the command line I naturally understand that to mean that you have a CGI script you want to run from the command line (possibly for debugging purposes to find out why it's hanging peoples' browsers). And if you are using: 'use CGI;' in myscript.pl, then you just do what my previous answer suggested: invoke the script from the command line with each form variable enumerated on the command line as key="value". Your script does use CGI.pm, right? If so, my previous advice was accurate whether you own your own server or use someone else's.
Dave
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein
| [reply] [d/l] [select] |
actually I own my own server
I am confused. Do you mean you wrote your own CGI parser?
| [reply] |
Assume that your script uses the CGI module, you can run the script in debug mode from command-line. There are many ways to do this, the following method is what I normally use:
perl cgi_script.pl var1=value1 var2=value2
Where var1 and var2 are form variables.
| [reply] [d/l] |
thanks guys,
that answered my question... What I meant was I do my own hosting/administration for my site and have access to the command line; unlike 95% of people with websites....
thanks,
-p
| [reply] |