On Tue, 30 Mar 2004 16:00:41 -0600
"JupiterHost.Net" <[EMAIL PROTECTED]> wrote:

> I'd rewrite the way you're doing it:
> 
>   my @records = @{$dbh->selectall_arrayref($query)};
>   print "Your search returned $#records results.";
>   for(@records) {
>     ...
>   }

$#records returns the index of the last element in the array. @records
in scalar context returns the number of elements in the array. With
array indices starting at zero, #$records + 1 == @records.

-- 
Smoot Carl-Mitchell
Systems/Network Architect
email: [EMAIL PROTECTED]
cell: +1 602 421 9005
home: +1 480 922 7313

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to