in reply to perl/linux passing form variables from command line

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

Replies are listed 'Best First'.
Re: Re: perl/linux passing form variables from command line
by th3monk3y (Novice) on Oct 24, 2003 at 04:23 UTC
    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
      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
      actually I own my own server

      I am confused. Do you mean you wrote your own CGI parser?