Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by aitap (Curate)
on Feb 17, 2013 at 18:43 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1019188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found