Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: ||= (poorly documented?)

by frozenwithjoy (Priest)
on Jul 09, 2012 at 06:31 UTC ( [id://980658]=note: print w/replies, xml ) Need Help??


in reply to Re: ||= (poorly documented?)
in thread ||= (poorly documented?)

To be fair, some things are a pain in the ass to google properly (especially if you aren't familiar with the topic in the first place). Also, documentation always makes more sense when you already know the topic. :P

Replies are listed 'Best First'.
Re^3: ||= (poorly documented?)
by dsheroh (Monsignor) on Jul 09, 2012 at 09:15 UTC
    This actually is easily googleable... if you're deep enough into the Perl culture. Try searching for it under the name "orcish maneuver", which will explain not only what the operator is but also exactly how it's being used in this case. (Link is to duckduckgo's first result, which just happens to also be on PerlMonks.)

    Also note that, because of the distinction between truthiness and definedness mentioned in previous replies, you're going to want to use //= instead of ||= in the vast majority of cases unless your code needs to support pre-5.10 versions of Perl.

      If you are "deep enough in the Perl culture" to know to google "orcish maneuver", you probably don't need to look it up. On the other hand, if all you know to google is "||=", you're screwed unless you think to try "double pipe equals".
Re^3: ||= (poorly documented?)
by Anonymous Monk on Jul 09, 2012 at 14:56 UTC
    To be fair ...

    Teach a man how to find answers and you teach him for life.
    Answer his questions for him and you get Perlmonks XP.

      You got me, the only reason I'm on here is to accumulate XP so I can get more spells and a larger HP pool next level.

      Seriously though, I think the OP did a decent job trying to figure things out before posting. S/he read the obvious doc, did some troubleshooting, and had a nearly correct understanding of the ||= operator, but was unsure and needed confirmation and a little guidance. I think the OP's main issue is that the reader of perlop needs to extrapolate some of the function of ||= from the examples for += and the OP may have missed that. Regarding // vs ||, even some of the people answering had some confusion.

      OK, that's my two cents. Now I'm off to Reddit, where the votes actually matter!

Re^3: ||= (poorly documented?) (on truthiness)
by Anonymous Monk on Jul 09, 2012 at 22:10 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-20 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found