Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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.


Comment on Re: Running shell script which needs runtime input through perl
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (19)
As of 2015-07-07 19:50 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 (93 votes), past polls