Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Passing an array back from a subroutine

by Generoso (Prior)
on Aug 03, 2010 at 17:00 UTC ( [id://852702]=note: print w/replies, xml ) Need Help??


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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://852702]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found