http://www.perlmonks.org?node_id=622867


in reply to Simple db select output script hanging up.

replace
$k = 0; while (@results = $sth->fetchrow_array()) { $data[$k] = [ @results ]; $k++; }
with
while($results = $sth->fetchrow_array_ref()) { push @data, $results; }

and see if that makes any difference

Also, it seems to me that you don't have 'use strict;' or 'use warnings;' - add them and you might find that Perl will point out an obvious error

Replies are listed 'Best First'.
Re^2: Simple db select output script hanging up.
by punch_card_don (Curate) on Jun 22, 2007 at 18:09 UTC
    Another interesting suggestion - so I tried it (with the necessary typo correction from fetchrow_array_ref to fetchrow_arrayref) - no change.

    As for strict and warnings, the presented code is just the pertinent snippet.