in reply to Running a CGI script from a command line?
Using the debugging feature you can write
#!/usr/bin/perl -- use strict; use warnings; use Capture::Tiny qw/ capture /; ... #~ my @cmd = ( $^X , 'foo.cgi', qw/ a=A b=B c=C/ ); my @cmd = ( $^X , 'foo.cgi', CGI->new->self_url ); my( $stdout, $stderr, $exit ) = capture { system { $cmd[0] } @cmd; };;
Capture::Tiny for avoiding the shell
Other ways are are shown in the tests, https://metacpan.org/source/LEEJO/CGI-4.20/t/form.t
Other ways are CGI::Test, CGI::Compile/CGI::Emulate::PSGI, Dancer::Plugin::FakeCGI ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Running a CGI script from a command line?
by Your Mother (Archbishop) on Jun 16, 2015 at 03:35 UTC | |
by shanen (Initiate) on Jun 16, 2015 at 05:35 UTC | |
by shanen (Initiate) on Jun 16, 2015 at 06:35 UTC | |
by Anonymous Monk on Jun 16, 2015 at 06:33 UTC | |
by shanen (Initiate) on Jun 16, 2015 at 06:40 UTC | |
by Anonymous Monk on Jun 16, 2015 at 08:16 UTC | |
by shanen (Initiate) on Jun 17, 2015 at 05:30 UTC | |
|