Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#============================= sub my_execer($) { my ($sql) = @_; my $sth = $dbh->prepare($sql) || undef; $sth->execute() || die "sth->execute: $DBI::errstr"; my @row; my @retval; if (@row = $sth->fetchrow_array) { my ($id, $prod) = @row; my $itm = new Item; $itm->id($id); $itm->type($prod); print Dumper $itm; push (@retval,\$itm); } $sth->finish; print "\@retval contains $#retval \n"; return (\@retval); }
Title edit by tye as single-word titles interfere with future simple searches
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: push
by seattlejohn (Deacon) on Mar 14, 2002 at 20:11 UTC |