Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: First steps in OO-Perl , suggestions please!

by davis (Vicar)
on Jul 25, 2002 at 11:40 UTC ( [id://185170]=note: print w/replies, xml ) Need Help??


in reply to First steps in OO-Perl , suggestions please!

2 thoughts spring to mind from skimming over your code:

Please, please use POD. I initially stayed away from it, but the effort required to learn really is minimal. Even if it's only you using the module, there's something satisfying about being able to do perldoc My::Module

In your constructor, you've hardcoded the required arguments - you may wish to try something like this:

my $args = { @_ }; #Check for required values foreach my $required qw(arg1 arg2 arg3) { if(!defined($args->{$required})) { carp("Required value $required missing\n"); return undef; } }
This tends to make the code a lot easier to update.
davis
Is this going out live?
No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist

Replies are listed 'Best First'.
Re: Re: First steps in OO-Perl , suggestions please!
by kodo (Hermit) on Jul 25, 2002 at 13:10 UTC
    Uhm yea I planned to write a POD once it's really done. I've already had a look at it and it's pretty easy to write so I'll definitly use it.
    Good idea about the constructor!

    giant

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found