in reply to Calling cgi from the command line

If you use CGI, as you appear to, then you'll be prompted for parameters when the script runs from the command line. Enter them in parameter=value pairs with a return after each, and hit ctrl-D when you're done to continue running the script. If you don't use CGI.pm, this would probably be a good time to start.

And you will need to remove the taint flag, else perl will rightly complain that it's too late for that. You can use it on the command line instead. I'd leave the warnings flag there though, if I were you. Slightly defeats the object to use it only when you can't see the output...

update or, as wardk says, by appending name=value pairs, which is easier when you have to do it repeatedly, but i seem to have got out of the habit. still depends on using CGI.pm. all the details are in the docs.

Replies are listed 'Best First'.
Re: Re: Calling cgi from the command line
by grep (Monsignor) on May 06, 2002 at 00:39 UTC

    And you will need to remove the taint flag, else perl will rightly complain that it's too late for that. You can use it on the command line instead. I'd leave the warnings flag there though, if I were you. Slightly defeats the object to use it only when you can't see the output..

    I would advise against this, leave the -T in the program and add it as a command line switch to avoid the 'Too late for Taint' message. If you run around adding and removing the -T ,you open your script up for the mistake of forgetting to put it back in.

    perl -T script.cgi name=value



    grep
    Unix - where you can throw the manual on the keyboard and get a command