in reply to Re: Executing code block in memory
in thread Executing code block in memory
The output I get with this is:#!/usr/bin/perl -w use URI::Escape; use HTML::Entities; use CGI qw/:standard/; print "Content-type: text/html\n\n"; my $file; if(param('test')){ my $code = param('test'); $code = uri_unescape($code); $code = encode_entities($code); open STDERR, '>&STDOUT'; open my $fh, '>', \$file; print $fh $code; close $fh; open my $pipe, '-|', "perl -w $file"; close $pipe; close STDERR; }
This is what is passed to the script:sh: -c: line 0: syntax error near unexpected token `;;' sh: -c: line 0: `perl -w print "hi";'
print "hi"; print "hello world\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Executing code block in memory
by kennethk (Abbot) on Aug 08, 2012 at 22:18 UTC |