Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 examining the Monastery: (4)
As of 2025-06-23 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.