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.