in reply to OO Perl Problems

The standard is to name the sub "new" not "New".

And personally I dont think the || ref trick is bad, and the document you are studying explains it in detail. But broquaint is correct it is the subject of debate around here on occassion. And hes correct that it can bite you, but IMO normally doesnt.

update: Also, use the syntax that tadman shows, not the indirect object syntax my $obj=new Class as it will bite you eventually.

--- demerphq
my friends call me, usually because I'm late....

Replies are listed 'Best First'.
Re: Re: OO Perl Problems
by John M. Dlugosz (Monsignor) on Sep 13, 2002 at 20:55 UTC
    write
    my $obj= new Class::;
    and the trailing button operator removes any ambiguity in the indirect-object form.
      Blech.
      my $obj=Class->new;
      Is much nicer to read IMO, especially when arguments are needed for the method call. (but thanks for pointing that out.... Learn somthing new every day.)

      --- demerphq
      my friends call me, usually because I'm late....

        some time ago i saw code like this:
        my $obj=Class::->new;
        whats the exact meaning of this?