(jcwren) RE: Yet Another CGI question
by jcwren (Prior) on Jun 15, 2000 at 00:18 UTC
|
Or, change your 'use' statement to:
use CGI qw/:standard -no_debug/;
and you won't be prompted. This is useful if your script will be parsing/generating HTML but won't be invoked through the webserver.
--Chris | [reply] [Watch: Dir/Any] [d/l] |
Re: Yet Another CGI question
by lhoward (Vicar) on Jun 15, 2000 at 00:10 UTC
|
Well, if you don't want to enter any of the CGI name/value pairs
just hit CONTROL-D. If you do want, enter the pairs, one on
a line, then hit CONTROL-D. | [reply] [Watch: Dir/Any] |
|
On Windows, it's Ctrl-Z. In both cases, enter it at the
start of a line. That sends the program "end of file",
ending the read, and you can all move on with your lives.
| [reply] [Watch: Dir/Any] |
|
And if the HTML is too long for you to look at on the screen, you can either pipe it into less (or favorite pager), or on a windows machine, redirect the output to a file.
perl foo.pl | less
or
perl foo.pl > foo.htm
With the second method, you can pull up a browser and check out what it looks like also.
#!/home/bbq/bin/perl
# Trust no1!
| [reply] [Watch: Dir/Any] [d/l] |
Re: Yet Another CGI question
by Odud (Pilgrim) on Jun 15, 2000 at 00:23 UTC
|
Or enter some dummy params as in
$query = new CGI('dinosaur=barney&color=purple');
| [reply] [Watch: Dir/Any] [d/l] |
Re: Yet Another CGI question
by plaid (Chaplain) on Jun 15, 2000 at 00:12 UTC
|
cntl-D for unix variants, and I believe cntl-Z for Windows. | [reply] [Watch: Dir/Any] |
RE: Yet Another CGI question
by le (Friar) on Jun 15, 2000 at 00:11 UTC
|
It's not a bug, it's a feature:
Just like passing variables via GET or POST, you have to give varibles like 'foo=bar'. Just hit Ctrl-D one or more times (depends on how many parameters it expects), then your script finishes. | [reply] [Watch: Dir/Any] |
Re: Yet Another CGI question
by husker (Chaplain) on Jun 15, 2000 at 23:58 UTC
|
another way is just to pass some dummy params in on your
command line:
$ mycgi.pl m=m
satisfies the Perl interpreter, without worrying about
pressing CTRL keys or anything like that. Handy if you
are wanting to test inside a standard shell script or batch
file. | [reply] [Watch: Dir/Any] [d/l] |
Re: Yet Another CGI question
by chromatic (Archbishop) on Jun 15, 2000 at 00:11 UTC
|
You can hit CTRL-D (or whatever the appopriate combination is for end-of-input on Windows) to simulate a query-string. You can also redirect data from a file or from echo to the program (through standard input). | [reply] [Watch: Dir/Any] |