CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Help with arrays

 



zabbala
New User

Oct 1, 2007, 7:20 AM

Post #1 of 2 (256 views)
Help with arrays Can't Post

hey there,
I have a method that runs an SQL SELECT statement and returns an array of results. When I run the SQL directly in SQL Developer, I get the results I expect (2 results). However, in Perl, when I try to display the contents of the array, this is what gets displayed: ARRAY(0x3ab8f98). I don't know what I'm doing wrong, but here's the code that should display the array:


Code
 my @case_list = $dbh->selectall_arrayref($SQL);  
my $list = join(', ', @case_list);
return $list;



Can anybody help?
Thanks


wgeoghegan
Novice

Oct 6, 2007, 10:30 AM

Post #2 of 2 (252 views)
Re: [zabbala] Help with arrays [In reply to] Can't Post

Try this:


Code
my $array_ref = $dbh->selectall_arrayref($SQL);   
my $list = join(', ', @$array_ref);
return $list;


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives