Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: redirecting stdin on windows

by myocom (Deacon)
on Aug 21, 2002 at 16:36 UTC ( #191787=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: redirecting stdin on windows
in thread redirecting stdin on windows

Funny, it works for the following (on WinXP):

script.pl
print "username: "; chomp ($uname = <STDIN>); print "\npassword: "; chomp ($password = <STDIN>); print "\nYou entered username $uname and password $password\n";
answer.txt
someusername somepassword
And I'm calling it like this:
perl script.pl < answer.txt
...which produces this:
C:\test\scratch>perl script.pl < answer.txt username: password: You entered username someusername and password somepassword
...which is the expected output.
"One word of warning: if you meet a bunch of Perl programmers on the bus or something, don't look them in the eye. They've been known to try to convert the young into Perl monks." - Frank Willison


Comment on Re: Re: Re: redirecting stdin on windows
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2015-07-30 15:53 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 (272 votes), past polls