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