Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^6: $_ not set in while <>

by LanX (Sage)
on Jun 09, 2021 at 14:15 UTC ( #11133689=note: print w/replies, xml ) Need Help??

in reply to Re^5: $_ not set in while <>
in thread $_ not set in while <>

For those wondering:
  • Misunderstanding 1:


    • Having relatively high density.
    • Slow to comprehend; of low intelligence.

  • Misunderstanding 2:
    Marshall was only attempting to read from the keyboard (and misunderstanding the OP)

    That's why he didn't care about checking defined for the line, since undef is a way to indicate EOF for files.

    But the special power of while(<>) is that he could call it on a file in @ARGV for testing those manual inputs

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^7: $_ not set in while <>
by ikegami (Pope) on Jun 09, 2021 at 19:06 UTC

    What are you talking about. We were both discussing density, and we were both talking about a terminal (or at least didn't exclude it).

    Perhaps you think a terminal can't return EOF? Yet that's a common occurrence. I didn't say those things you tried to put in my mouth cause I didn't mean those things.

    A program that fails to handle a common occurrence by going into an infinite loop is bad, and a style that makes this kind of error easy and hard to notice is not that great. Simple as that.

    Seeking work! You can reach me at

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2021-09-24 02:46 GMT
Find Nodes?
    Voting Booth?

    No recent polls found