Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by Burak (Chaplain)
on May 09, 2009 at 17:03 UTC ( [id://763057]=note: print w/replies, xml ) Need Help??


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

You're possibly right :)

Replies are listed 'Best First'.
Re^6: $obj->method v.s. $obj->method()
by AnomalousMonk (Archbishop) on May 09, 2009 at 18:40 UTC
    FWIW: In both versions 5.004_02 and 5.004_04 (from different builds) that I have:
    • $obj->method; (no arguments) and  $obj->method(@args); (with arguments) both work;
    • no non-parenthesized invocation with arguments (of those I have tried) works.
      can you also try this:
      my $method = "foo"; $obj->$method; $obj->$method @args;
        my $method = "foo"; $obj->$method; $obj->$method @args;
        On both 5.004_02 and 5.004_04:
        • $obj->$method; and $obj->$method @args; both fail to compile;
        • $obj->$method(); and $obj->$method(@args); both compile and execute as expected.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-05-25 21:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found