Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: <> oddity ?

by hdb (Monsignor)
on Mar 27, 2013 at 10:17 UTC ( #1025667=note: print w/replies, xml ) Need Help??


in reply to <> oddity ?

while(<>)

reads from STDIN. Try this script:

while(<>) { print; }

This should behave similar to yours under your 3 scenarios.

$ ./weird.pl sample.txt whereas $ ./weird.pl <sample.txt or $ cat sample.txt | ./weird.pl
UPDATE: I am stupid and should read "Programming Perl" again. Apologies for posting useless stuff. No idea what goes wrong with your code.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025667]
help
Chatterbox?
[Discipulus]: msgd daxim about his post is almost empty: in 15 minutes i'll mark for reaping
virtualsue remembers to warn Corion that Liverpool Street station is going to be a nightmare when he gets there. :-)
[virtualsue]: Copy pasta FTW!

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2017-11-22 12:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (319 votes). Check out past polls.

    Notices?