Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: A first attempt.. at OO perl

by moritz (Cardinal)
on Jul 03, 2008 at 09:24 UTC ( [id://695318]=note: print w/replies, xml ) Need Help??


in reply to Re^2: A first attempt.. at OO perl
in thread A first attempt.. at OO perl

As a user of an OO module, one typically uses the package name only to invoke the new method:
my $obj = Your::Package->new(%options); $obj->do_something; $obj->do_something_other(@args);

Consider reading perltoot, or if that doesn't help you, read a book on object orientation in general (doesn't really have to be perl related).

Replies are listed 'Best First'.
Re^4: A first attempt.. at OO perl
by why_bird (Pilgrim) on Jul 03, 2008 at 11:10 UTC
    I did read perltoot---I assumed that because you called new like that you had to call everything else like that too. Think I will pick up the book recommended by TGI and/or any others that people can suggest. I'm happy that I'm wrong about how to call methods, it did worry me at first, always having to include the object as an argument, the way you've shown me is much nicer!
    ........
    Those are my principles. If you don't like them I have others.
    -- Groucho Marx
    .......

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found