Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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?
NodeReaper recites The Raven over the P.A. again

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-06-24 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (562 votes). Check out past polls.