[sf-perl] Debugging a CGI script - how

Joe Brenner doom at kzsu.stanford.edu
Sat Mar 8 13:19:38 PST 2008


Kevin Frost <biztos at mac.com> wrote:

> Joe Brenner wrote:
> >  print STDERR "The value is: $value at " . __LINE__ . "\n";

> I would also add that if you're doing fetchrow_arrayref or similar you
> might want to temporarily switch to _hashref and use the Dumper:
>
> use Data::Dumper qw(Dumper);
>
> # ...set up db connection and query, etc.
>
>
> my $rownum = 0;
> while (my $row  = $sth->fetchrow_hashref) {
> 	# 4th on is tricky...
> 	$rownum ++;
> 	printf STDERR "ROW %d: %s\n", $rownum, Dumper($row);
>
> }
>
> ...or words to that effect.

Sure, sounds good.

I just thought I'd make the point that there isn't any particularly need
to avoid using fetchrow_hashref.  As I remember it, the performance
penalty on doing that was fixed a while back.



More information about the SanFrancisco-pm mailing list