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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [hwnd] Reading results back that were dumped?: Edit Log

Veteran / Moderator

Apr 10, 2013, 10:58 AM

Views: 21382
Re: [hwnd] Reading results back that were dumped?

In Reply To
I know you can check the increments without using C style for, It just seems more likely for checking how many rows are coming in. You said use foreach rather, how come?

Fishmonger gave you an answer. But you could even do without the $i variable, by dereferencing the the references at the first level of your array, with a syntax of this form:

foreach my $row_ref (@$sth) { 
my @cols = @{$row_ref};
# do something with @cols

I do not have your data at hand and could not test it, but it should work I I understood correectly your data structure.

(This post was edited by Laurent_R on Apr 10, 2013, 2:29 PM)

Edit Log:
Post edited by Laurent_R (Veteran) on Apr 10, 2013, 2:29 PM: added a missing semi-colon in the posted code

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

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