Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: <> oddity ?

by hdb (Parson)
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.


Comment on Re: <> oddity ?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-08-30 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls