Since I am passing a reference to an anonymous hash
when calling the new method, the @_ only contains one
element, that reference. The '$objRef = shift;' in
the constructor brings the hash ref into the function.
When I print out the $self in my resize function, I
see the list, so it definitely exists in my blessed
$self object.
--- "Carmichael, Lee" <[EMAIL PROTECTED]>
wrote:
> > This should be very easy but apache is not letting
> me
> > do this. I have a list of file names stored in an
> > array. The list is created as follows:
> >
> > push @resizeList, $img->{path} . $img->{file};
> >
> >
> > The list is passed to a package via a new method
> as
> > follows:
> >
> > my $imageResize =
> Ishare::Classes::ImageClass->new(
> > {
> > resize_list => [EMAIL PROTECTED]
> > } );
> >
> >
> > The new method is as follows:
> >
> > sub new {
> > my $this = shift;
> > my $class = ref($this) || $this;
> > my $objRef = shift;
> >
> > bless $objRef, $class;
> > return $objRef;
> > }
>
> I don't think you actually setup the array in the
> constructor. Don't you
> want something like:
>
> my %p = @_;
> $objRef->{resize_list} = $p{'resize_list'} || [];
>
>
> Good Luck,
>
> Lee
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com