[sf-perl] Debugging a CGI script - how

Kevin Frost biztos at mac.com
Sat Mar 8 12:54:11 PST 2008

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.

-- f.

On Mar 8, 2008, at 12:32 PM, Joe Brenner wrote:

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

More information about the SanFrancisco-pm mailing list