Perl Problem

Scott Penrose scottp at
Mon Sep 8 21:01:10 CDT 2003

Hash: SHA1

On Tuesday, Sep 9, 2003, at 11:25 Australia/Melbourne, Rick Measham 

> As everyone seems to be hanging around this morning, let me post a 
> programming question:
> Given that $locations is a ref returned from DBI's 
> $dbh->selectall_arrayref():
> 	foreach my $location (@{$locations}) {
> 		next unless @{$location};
> 		print join("\t", @{$location}) . "\n";
> 	}
> Why does my app hang and then exactly 5 minutes later fill my apache 
> error_log with 120 lines of:
> [Tue Sep 09 11:13:05 2003] [error] [client] Use of 
> uninitialized value in join or string at ./modules/ line 
> 342.

No idea why it is hanging, very odd... You could try adding in "print 
STDERR" lines in your code which will go into the logs time stamped so 
you can see WHERE it is blocking. Or you can use Devel::PTKDB to debug 
it visually.

As for the unitialized value, only ONE of the entries returned in your 
array and you will get that each time. So for example you have 120 
lines, which suggests maybe 4 of the returned entries are NULL which 
equate to undef in perl after coming through DBI.

> The select when pasted into psql returns 33 rows, so I'm not sure 
> what's going on here...
> Any help muchly appreciated.
> Cheers!
> Rick Measham

- -- 
Scott Penrose
Welcome to the Digital Dimension
scottp at

Dismaimer: Contents of this mail and signature are bound to change 
randomly. Whilst every attempt has been made to control said 
randomness, the author wishes to remain blameless for the number of 
eggs that damn chicken laid. Oh and I don't want to hear about 
butterflies either.
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see


More information about the Melbourne-pm mailing list