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

Re^3: $obj->method v.s. $obj->method()

by ikegami (Patriarch)
on May 09, 2009 at 16:24 UTC ( [id://763054]=note: print w/replies, xml ) Need Help??


in reply to Re^2: $obj->method v.s. $obj->method()
in thread $obj->method v.s. $obj->method()

qw(b a) is (currently) equivalent to ('b', 'a') at a very low level. The parser only sees the latter.

It also fools the x operator.

>perl -le"$,=', '; print qw( a b c ) x 3" a, b, c, a, b, c, a, b, c >perl -le"$,=', '; print sub { qw( a b c ) }->() x 3" ccc

Update: Even high level stuff like for.

>perl -le"for my $x qw( a b c ) { print $x }" a b c

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-05-18 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found