Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Re: OO Perl Problems

by demerphq (Chancellor)
on Sep 13, 2002 at 20:59 UTC ( [id://197734]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: OO Perl Problems
in thread OO Perl Problems

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....

Replies are listed 'Best First'.
4**Re: OO Perl Problems
by kabel (Chaplain) on Sep 14, 2002 at 06:31 UTC
    some time ago i saw code like this:
    my $obj=Class::->new;
    whats the exact meaning of this?
      This makes sure that the method new from the class/package Class is called. This makes just a difference if in the caller package is a sub called Class. See e.g.
      H:\>perl package Class; sub new { print "hello\n"; } package main; sub Class { print "not in Class\n"; } Class->new(); ^Z not in Class Can't call method "new" without a package or object reference at - lin +e 9. H:\>
      Here main::Class is called by accident...

      Best regards,
      perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-24 09:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found