Re: New to OO Perl

2007-05-03 Thread Nigel Peck
Thanks, I read 'Intermediate Perl' but I'll have a look at these too. Thanks to Ovid and Robert for your suggestions too. Cheers, Nigel Chas Owens wrote: On 5/2/07, Nigel Peck <[EMAIL PROTECTED]> wrote: Hi all, I'm new to writing Object Oriented Perl and am hoping for some advice? snip Y

Re: New to OO Perl

2007-05-03 Thread Chas Owens
On 5/2/07, Nigel Peck <[EMAIL PROTECTED]> wrote: Hi all, I'm new to writing Object Oriented Perl and am hoping for some advice? snip You may want to read "Object Oriented Perl" by Conway and "Design Patterns" by Gamma, et al. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Re: New to OO Perl

2007-05-03 Thread Ovid
--- Nigel Peck <[EMAIL PROTECTED]> wrote: > A cut down version of my code goes like this... > ## > > package MIS::Common::Image_magick; > > use Image::Magick; > > sub new { > > my ( $class, $data ) = @_; > >

Re: New to OO Perl

2007-05-02 Thread Robert Boone
You may want to seperate your initialization from instantiation. sub new { my ( $class, $data ) = @_; my $self = bless {}, $class; $self->init(); return $self; } sub init { my ($self) = @_; $self->{image_magick_object} = Image::M

New to OO Perl

2007-05-02 Thread Nigel Peck
Hi all, I'm new to writing Object Oriented Perl and am hoping for some advice? I found the need to use Image::Magick tonight and in order to reuse the code in future I put it in a package of subs. I then thought it seemed like a good opportunity to try writing an OO module so I did. Howev