Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

CGI -debug question

by freddo411 (Chaplain)
on Jun 04, 2003 at 21:49 UTC ( [id://263160]=perlquestion: print w/replies, xml ) Need Help??

freddo411 has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I'm trying to utilize the CGI -debug option to allow me to test my cgi from the command line. The script in question works fine without the -debug option.

When I use the -debug option, I am able to enter name=value pairs on the command line after seeing:

"(offline mode: enter name=value pairs on standard input)"

What I would like to know how to do is pipe these name=value pairs in from a file. For example:

foo.pl < nvPairs.txt

When I try to do this, the script runs, says:

"(offline mode: enter name=value pairs on standard input)"
and sits there in an apparent infinite loop happily ignoring ^D ^C and everything except ^Z.

Anyone have some helpful pointers?

-----------------------------
Nothing is too wonderful to be true
-- Michael Faraday

Replies are listed 'Best First'.
Re: CGI -debug question
by arthas (Hermit) on Jun 04, 2003 at 22:15 UTC
    foo.pl < nvPairs.txt

    To me this syntax works correctly (under Linux), and the script doesn't hang at all. However, you may try:

    cat nvPairs.txt | ./foo.pl # Unix type nvPairs.txt | foo.pl # Windows

    Michele.

Re: CGI -debug question
by crouchingpenguin (Priest) on Jun 05, 2003 at 02:42 UTC

    You can also just as easily do:

    perl foo.pl "key1=value1&key2=value2&key3=value3"

    cp
    ----
    "Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://263160]
Approved by Enlil
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-03-19 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found