my $itemref = Item::Item->new( "10056" ); my @item = @$itemref; print $item[0]->{_description}, "\n"; #### sub get_desc { $_[0]->{_description}; } #### Can't call method "get_desc" on unblessed reference at testitem.pl line 17 (#1) (F) A method call must know in what package it's supposed to run. It ordinarily finds this out from the object reference you supply, but you didn't supply an object reference in this case. A reference isn't an object reference until it has been blessed. See perlobj. Uncaught exception from user code: Can't call method "get_desc" on unblessed reference at testitem.pl line 17. at testitem.pl line 17 #### sub get_desc { my (@class, $count) = @_; return $class[$count]->{_description}; } At the print statement print @item->get_desc(), "\n"; print $itemref->get_desc(), "\n"; #### sub new { my ($class, @arg) = @_; $class->_incr_count(); my (@item, $ref, @objref); $sth->execute($company, $_[1]); $sth->bind_columns(undef, \$item[0], \$item[1], etc.. while ($ref = $sth->fetchrow_arrayref()) { $objref[$i] = ( { _item => $item[0] || "", _available => $item[1] || "", _brand => $item[2] || "", etc.. } ); $i++; } return bless \@objref, $class; } # End sub new #### sub get_desc() { my $self = shift; if (ref $self) { return ${ $self->{"_description"} }; } else { return $self->{_description}; } } #### print $itemref->get_desc(), "\n"; #### Pseudo-hashes are deprecated at /usr/local/www/cgi-pbin/pmpl/item.pl line 119 (#1) (D deprecated) Pseudo-hashes were deprecated in Perl 5.8.0 and they will be removed in Perl 5.10.0, see perl58delta for more details. You can continue to use the fields pragma. Argument "POLLOCK SUBMARINER BTR 3.2 OZS" isn't numeric in hash element at /usr/local/www/cgi-pbin/pmpl/item.pl line 119 (#2) (W numeric) The indicated string was fed as an argument to an operator that expected a numeric value instead. If you're fortunate the message will identify which operator was so unfortunate. Bad index while coercing array into hash at /usr/local/www/cgi-pbin/pmpl/item.pl line 119 (#3)(F) The index looked up in the hash found as the 0'th element of a pseudo-hash is not legal. Index values must be at 1 or greater. See perlref. Uncaught exception from user code: Bad index while coercing array into hash at /usr/local/www/cgi-pbin/pmpl/item.pl line 119. at /usr/local/www/cgi-pbin/pmpl/item.pl line 119 Item::Item::get_desc('Item::Item=ARRAY(0x8135c88)') called at testitem.pl line 17