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

Re: <> oddity ?

by hdb (Prior)
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 avoiding work at the Monastery: (2)
As of 2014-10-02 00:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls