Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Brothers Vars

by ZlR (Chaplain)
on Apr 07, 2005 at 10:24 UTC ( #445601=note: print w/replies, xml ) Need Help??


in reply to Brothers Vars

ah, here's my decoding of it :)

there are two lists : @_ and @__ . they each have 25 elements, which is also the number of chars in "just another perl hacker," ...
Then we have a subroutine named _ called with two arguments that are references to the previously defined array .
And what does this _ sub do ? Well it pops an element from each list, do a | operator on them and print the results.
The arrays are called with the form  @{$_[0]} and  @{$_[1]} because it's a dereferencing of a reference passed in @_

After this the _ sub calls itself, but only if there are elements left in the array, thus ensuring that along with the pop it ends after 25 calls .

So it happens that these previous brother vars when bitwise OR'ed with each other print the japh !

Cheers,
Z

Replies are listed 'Best First'.
Re^2: Brothers Vars
by cristian (Hermit) on Apr 07, 2005 at 13:40 UTC
    Yes , in resume. The Recursive sub "_" is a luxury. The true interesting is "|" operator and char in left and right. example. perl -e "print ('$'|'(')"; => "," The operator |produce in some case other symbol, according to brothers. It is fun.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2022-05-18 20:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (71 votes). Check out past polls.

    Notices?