RE: anyway to determine # rows before fetch loop ends and without seperate count(*)
- From: rjk-dbi@xxxxxxxxxxx (Ronald J Kimball)
- Date: Fri, 18 Nov 2005 10:10:42 -0500
listmail [mailto:listmail@xxxxxxxxxxxx] wrote:
>
> Well I'm not seeing why a number of arrays that each point to arrays
> could not be consider a matrix of arrays when considering one definition
> of the word matrix "Something resembling such an array, as in the
> regular formation of elements into columns and rows". I dunno, i'm not
> trying to argue with you of course. It is apparent that I truly am
> confused with Perl References again. I beleive my main mistake could be
> using "foreach my $record (@{ $results })" instead of what you've shown
> "for my $record (@{ $results })". I'll test this later when I get a
> chance and also see how I can include the use of bind variables while
> using this method as well.
>
You can certainly call it a matrix if you want to, but other people may not
know what you mean. (I didn't, when I read your original post.) The
standard Perl terminology is to call it an array of arrays.
foreach and for in Perl are completely interchangeable.
These two are the same:
foreach my $x (@list)
for my $x (@list)
These two are also the same:
for (my $i = 0; $i < 10; ++$i) {
foreach (my $i = 0; $i < 10; ++$i) {
Which you use is merely style/personal preference.
Ronald
.
- References:
- Prev by Date: Re: anyway to determine # rows before fetch loop ends and without seperate count(*)
- Next by Date: RE: anyway to determine # rows before fetch loop ends and without seperate count(*)
- Previous by thread: Re: anyway to determine # rows before fetch loop ends and without seperate count(*)
- Next by thread: Re: anyway to determine # rows before fetch loop ends and without seperate count(*)
- Index(es):
Relevant Pages
|
|