running perl at command line with arguments: script.cgi?text=text 
Author Message
 running perl at command line with arguments: script.cgi?text=text

I am trying to debug a script at the command line, and I was wondering if
there was a way to have the argument entered at the command line as it does
work when running the actual cgi application from the web page.

For example the script looks like this:

www.../cgi-bin/script.cgi?testtext

how does it work at the command line:

perl script.cgi ????? <--- what do I put here?

Could anyone help me?

Thanx,
Adam



Fri, 29 Sep 2000 03:00:00 GMT  
 running perl at command line with arguments: script.cgi?text=text

Quote:

> I am trying to debug a script at the command line, and I was wondering
> if there was a way to have the argument entered at the command line as
> it does work when running the actual cgi application from the web page.

Yes, you can emulate the Common Gateway Interface (CGI). Or, if you're
using CGI.pm or a similar module, that ability is built-in to the module.

If you decide to emulate the Common Gateway Interface and have troubles,
people in a newsgroup about CGI may be able to help you. Good luck!

--
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



Sat, 30 Sep 2000 03:00:00 GMT  
 running perl at command line with arguments: script.cgi?text=text


in <URL: :">
++ I am trying to debug a script at the command line, and I was wondering if
++ there was a way to have the argument entered at the command line as it does
++ work when running the actual cgi application from the web page.
++
++ For example the script looks like this:
++
++ www.../cgi-bin/script.cgi?testtext
++
++ how does it work at the command line:
++
++ perl script.cgi ????? <--- what do I put here?

Whatever you like - it all depends on how you deal with commandline
arguments. The CGI specification tells you how "testtext" is passed
to your program - and that's not but putting in on the command line.

If you want to test it out by putting things on the command line,
you have to write code to deal with that situation. And if you write
the code, you will know what to put where.

Abigail
--



Sat, 30 Sep 2000 03:00:00 GMT  
 running perl at command line with arguments: script.cgi?text=text

Quote:

> I am trying to debug a script at the command line, and I was wondering if
> there was a way to have the argument entered at the command line as it does
> work when running the actual cgi application from the web page.

> For example the script looks like this:

> www.../cgi-bin/script.cgi?testtext

> how does it work at the command line:

> perl script.cgi ????? <--- what do I put here?

> Could anyone help me?

> Thanx,
> Adam

I was like you,  once ... debugging cgi's by hand, writing to log files
and wishing I could call my cgi instead of httpd ...

But no more!  :-)

Seriously, use CGI;
$query = new CGI;
$Name_o_a_variable = $query->param("Name_o_the_thing");

AND!  You can run it from command line, feeding it name, value pairs.

Not to mention it is Free ...  :-)

Cheers!
-------------------------------------------------------------
Andrew F. Lee                 |                              |
Software Engineer             |  parenttime.com              |

Phone: (212) 522-2769         |  New York, N.Y. 10020        |
-------------------------------------------------------------
        When I say, "Ignore the man behind the curtain."  
        That is because there is no man behind the curtain.



Sat, 07 Oct 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. running perl at command line with arguments: script.cgi?text=text

2. Getting command line arguments from cgi script (@ARGV)

3. Running a Perl/CGI form script from the command line

4. Running CGI perl script from command line

5. Q: using perl for cgi script that pulls lines from text file

6. Passing form values back to a script as command line arguments

7. passing arguments on the command line to the script

8. passing command-line arguments to script !

9. Piping to script w/ command line arguments

10. Passing command line arguments to script

11. script won't run...displays script text

12. Run perl script on web server from command line

 

 
Powered by phpBB® Forum Software