in reply to Foo->new() vs. new Foo()

The indirect syntax (new Foo) is problematic. I can't remember any specific examples, but I have seen errors due to ambiguities in the parsing of the indirect syntax. Foo->new is recommended.

Replies are listed 'Best First'.
Re^2: Foo->new() vs. new Foo()
by chromatic (Archbishop) on Oct 24, 2005 at 17:21 UTC

    With the indirect object syntax, the classname is a bareword. If Perl doesn't recognize the name of the class when it compiles the statement, there'll be trouble.