Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: detects only input after perl script is run.

by blue_cowdawg (Monsignor)
on May 03, 2013 at 15:41 UTC ( #1031915=note: print w/replies, xml ) Need Help??


in reply to <STDIN> detects only input after perl script is run.

If you wanted to send an "h" to standard input you should invoke your script

echo "h" | perl filename.pl
also another thought:
#!/usr/bin/perl -w use strict; #damn fine idea my $user_value=<STDIN>; chomp $user_vaule;


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^2: <STDIN> detects only input after perl script is run.
by tty1x (Novice) on May 03, 2013 at 16:49 UTC
    Noted on  use strict :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031915]
help
Chatterbox?
[LanX]: several people told me they like saigon. ..
[choroba]: well, beer is good here, surprisingly
[choroba]: also, I discovered several vegan/vegetarian restaurants, so I can avoid meat
[LanX]: ha ha ... happy Czech :)
[choroba]: been to the War Remnants Museum, too. Quite a brutal experience
[choroba]: but still, small-talk about smuggling guns and how Trump is great with US expats isn't my cup of tea
[LanX]: brutal beer?
[LanX]: met a Canadian yesterday, he suggested building a wall and let the US pay for it

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2017-02-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (371 votes). Check out past polls.