in reply to First steps in OO-Perl , suggestions please!
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:
This tends to make the code a lot easier to update.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; } }
|
|---|
| 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 |