in reply to Passing an array back from a subroutine
Fond several tings that where missing and/or misplaced.
compare your code with mine it works.
my $ff1 = 3; my @a_ff1; if ($ff1) {@a_ff1 = &GetRow("$ff1");}; print @a_ff1,"\n"; sub GetRow { my ($set) = $_[0]; my $sth = $dbh->prepare("SELECT `filter_partnumber`,`filter_fram` +,`filter_fleetguard`,`filter_notes` FROM `filter_desc` WHERE `filter_ +id` = ? ") or die $DBI::errstr; $sth->execute($set) or die $DBI::errstr; my @ary = $sth->fetchrow_array(); $sth->finish; return @ary; }
|
|---|