On Mon, Nov 19, 2001 at 05:09:45PM -0700, Keary Suska wrote:
> IIRC, technically, the for() would take more time but only noticeable with
> exceptionally large arrays. I seem to recall something about for() copying
> an array before iterating.

I'm not sure what you mean about for() copying an array before iterating.
That is certainly not the case.  In fact, the iterator variable is aliased
to each element of the array in turn, and modifying the iterator variable
modifies the element in the original array.  For example:

#!perl

my @array = (qw/tsuJ rehtona lreP rekcah/);
for my $word (@array) {
  $word = reverse $word;
}
print "@array,\n";

__END__


Ronald

Reply via email to