#============================= 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
In reply to push leaves $#retval 0 ? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |