in reply to •Re: Constructors Without ->new()
in thread Constructors Without ->new()

Now now, never say never. Especially not when it comes to Perl.

It's quite right that Constructor->foo will resolve to Constructor()->foo, but that's not the only way to call a class method. Both

  Constructor::->foo

and

  'Constructor'->foo

will be "class method invocation".

I even prefer to use Constructor::->foo over the one without colons, for reasons explained in Re: Capitalized subroutine names and packages.

ihb

Replies are listed 'Best First'.
•Re: Re: •Re: Constructors Without ->new()
by merlyn (Sage) on Oct 24, 2003 at 21:06 UTC
    Ahh, OK. Cool. I don't like having to call with an explicit hashref though. Maybe make it take a list and turn into a hash if it's not already a hashref. Maybe it does that already... dunno... I'm on a cellmodem link right now and didn't look.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.