Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Strange syntax question

by chromatic (Archbishop)
on Aug 14, 2013 at 16:15 UTC ( #1049439=note: print w/ replies, xml ) Need Help??


in reply to Strange syntax question

// isn't a comment in Perl. It's the defined-or operator. It's an infix operator, so it comes between two operands. If the left operand evaluates to a defined value, the operator produces the left operand's value. If the left operand evaluates to an undefined value, the operator produces the right operand's value.

In other words, shift off the first parameter to the function and assign its value to $it. If that's not a defined value, assign the value of $foo to $it instead.


Improve your skills with Modern Perl: the free book.


Comment on Re: Strange syntax question
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2014-08-28 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls