Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Re: Re: Re: Re: Re: OR operator

by DrManhattan (Chaplain)
on Apr 11, 2003 at 09:50 UTC ( [id://249844]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: Re: OR operator
in thread OR operator

I read $_ as "the thing" or "it". How do you read $_?

The original poster wanted this:

if ($color eq "blue || $color eq "red" || $color eq "green")
My second post essentially stated ...
if ($color eq $_)
... and dynamically replaced $_ with "blue", "red", or "green". Thus to me, $_ eq $color is like stating ...
if ("blue eq $color || "red" eq $color || "green" eq $color)
... which isn't intuitive.

-Matt

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found