Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Where automatic variable $_ doesn't work?

by haukex (Archbishop)
on Jul 04, 2016 at 20:04 UTC ( [id://1167168]=note: print w/replies, xml ) Need Help??


in reply to Where automatic variable $_ doesn't work?

Hi guiwp,

It's not "prohibited": How should Perl tell the difference between print $fh; and print $fh;? With the first one I meant "print the value of $fh to the currently selected filehandle" and with the second one I meant "print $_ to the filehandle $fh"? That's taking DWIM a little too far ;-)

Regards,
-- Hauke D

Replies are listed 'Best First'.
Re^2: Where automatic variable $_ doesn't work?
by guiwp (Sexton) on Jul 04, 2016 at 20:23 UTC

    I always thought Perl was taking DWIM a little too far! I assume the compiler (and the human that made it!) is pretty smart =)

    Thank you @haukex

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-18 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found