Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: running string as perl script and pass into STDIN programatically

by aitap (Deacon)
on Feb 17, 2013 at 18:43 UTC ( #1019188=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use IPC::Run 'run';
    my ($stdout, $stderr);
    run [ qw/perl -e/, $code ], '<', \$args, '>>', \$stdout, '2>>', \$stde
    +rr;
    
  2. or download this
    $ perl
    my $code = q[use feature 'say'; say for 1..10; warn 'zzz'; $z = <STDIN
    +>; $z=~y/a-z/A-Z/; say $z];
    my $args = q[this is STDIN, why not?];
    ...
    
    STDERR: zzz at -e line 1.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2015-07-28 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls