[ale] OO Perl
Christopher Fowler
cfowler at outpostsentinel.com
Fri Apr 16 07:01:26 EDT 2004
I implemented use of Error.pm last night. Give the ability to throw and
catch exceptions.
On Thu, 2004-04-15 at 22:42, Fletch wrote:
> >>>>> "Christopher" == Christopher Fowler <cfowler at outpostsentinel.com> writes:
>
> Christopher> I'm creating a Properties class to use with config
> Christopher> files for my cgi programs
>
> [...]
>
> Christopher> How can I store $options in a Properties object?
>
> Your blessed hash reference can store things just like any other
> hashref.
>
>
> sub parse_options {
> my $self = shift;
>
> ... your code ...
>
> $self->{'_options'} = $options;
>
> return $self;
> }
>
>
> See perldoc perltoot and perldoc perlboot, both of which should cover
> this usage.
>
>
> If you want to be really OOPy, you might also want to look into
> Class::MethodMaker for writing accessors automatically. Also look
> into the AppConfig module which handles parsing .INI-like config files
> for you.
More information about the Ale
mailing list