Tony,
Disregard that last e-mail of mine. I'm doing this
work via internet cafe(while re-locating) and did not
entirely digest your last copious response before I
sent my reply. Let me noodle with this and see how I
can fit it to my task. I think you have explained it
great.
Thanks again
Marty
--- Tony Foiani <[EMAIL PROTECTED]> wrote:
> >>>>> "Marty" == m keane <[EMAIL PROTECTED]>
> writes:
>
> Marty> This is what I'm looking for. My point about
> the
> Marty> foreach/fetchall_arrayref was only to
> indicate my
> Marty> limited experience using fetchall_arrayref.
> That's the
> Marty> only programming context in which I've used
> it.
>
> Fair enough. If you are just looping through
> sequentially, however,
> you should just use "fetch" to grab one row at a
> time. This avoids
> loading the whole result set into memory (although
> some DBD drivers do
> this anyway, much to my surprise and annoyance!).
> That is, instead
> of doing this:
>
> my $results_aref = $sth->selectall_arrayref();
> foreach $row (@$results_aref) { ... }
>
> Do something like this instead:
>
> $sth->execute();
> while (my $row = $sth->fetch()) { ... }
> $sth->finish();
>
> With small enough result sets, this won't matter;
> the latter is a much
> more common idiom for it, at least in my experience.
>
> Marty> I've been looking through the perl
> documentation on
> Marty> references,dereferencing, array & hash
> references...
>
> The canonical references come with perl:
>
> perldata -- perl data types
> perlref -- references
> perllol -- list of lists (a.k.a.
> array-of-array-refs)
> perldsc -- data structure cookbook
>
> That should cover all the intricacies of references
> in perl.
>
> Marty> The only thing I can't get my mind around is
> how would I change
> Marty> one of the array (fields) elements for the
> 1st record with this
> Marty> array of array-refs structure?
>
> Marty> I want the reference to stay as is.
>
> Hm. This is a little confusing, as you say you want
> it to stay "as
> is" but you want to change one of the array fields.
> I'm interpreting
> this to mean that you want to maintain the
> structure, but modify a
> value within one of the arrays. Is this correct?
>
> Marty> Because this is an array of array-references
> the syntax is
> Marty> eluding me :-\r
>
> Consider:
>
> my @array = ( 1, 2, 3 );
> my $a_ref = @array;
>
> Now, to
__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/