esharris has asked for the wisdom of the Perl Monks concerning the following question:
The next CGI script (called test8.pl) uses the system function to pass data to test7.pl#!/usr/bin/perl -w use strict; use CGI qw/:standard/; my $x = query_string() || 'undefined'; warn("x =$x"); print("Hello\n"); #print param('name')."\n";
If I run test8.pl from the shell, we see the passed parameters.#!/usr/bin/perl -w use strict; use CGI qw/:standard/; print header(), start_html('test'); print h1(system("./test7.pl name=5 val=3 x=13 > temp.dat; mv temp.dat +temp1.dat")); print h1(system("./test7.pl name=5 val=4")); print end_html();
If I run test8.pl from the browser, we don't see the parameters.x =name=5;val=3;x=13 at ./test7.pl line 8. x =name=5;val=4 at ./test7.pl line 8.
Why doesn't the system function pass the CGI parameters in? And why does the redirection fail?sh: line 1: temp.dat: Permission denied mv: temp.dat: No such file or directory x =undefined at ./test7.pl line 8.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why doesn't the system function pass the CGI parameters in?
by jasonk (Parson) on Dec 29, 2004 at 22:37 UTC | |
|
Re: Why doesn't the system function pass the CGI parameters in?
by dragonchild (Archbishop) on Dec 29, 2004 at 20:23 UTC | |
|
Re: Why doesn't the system function pass the CGI parameters in?
by Rocinante (Initiate) on Dec 29, 2004 at 21:04 UTC |