Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Running shell script which needs runtime input through perl

by Eliya (Vicar)
on Feb 02, 2012 at 15:01 UTC ( #951455=note: print w/replies, xml ) Need Help??


in reply to Running shell script which needs runtime input through perl

I think you want piped open:

open my $fh, "| ./setup.sh" or die $!; # print $fh "$_\n" for qw(a b c ...);

When you then say print $fh ..., the shell script gets the data on stdin, as it would from your current heredoc.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951455]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2016-12-04 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (61 votes). Check out past polls.