Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

by Your Mother (Archbishop)
on May 09, 2009 at 16:41 UTC ( [id://763056]=note: print w/replies, xml ) Need Help??

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

IIRC it's $obj->$method that wouldn't work in 5.4 (and 5.6?) while $obj->$method() would.

Replies are listed 'Best First'.
Re^5: $obj->method v.s. $obj->method()
by Burak (Chaplain) on May 09, 2009 at 17:03 UTC
    You're possibly right :)
      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;

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-05-25 08:08 GMT
Find Nodes?
    Voting Booth?

    No recent polls found