|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: running string as perl script and pass into STDIN programaticallyby aitap (Chaplain) |
| on Feb 17, 2013 at 18:43 UTC ( #1019188=note: print w/ replies, xml ) | Need Help?? |
|
I think that this will run your Perl code with STDIN fed and STDOUT/STDERR catched properly:
Example run:
__DATA__ will be broken unless you use real files instead of -e 'code' above. Feeding the code to STDIN (with "\n__END__\n" between the code and actual STDIN) may also work, but can break in strange ways with syntax errors in code.
Sorry if my advice was wrong.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||