At 01:08 PM 6/7/01 -0400, Robin Lavallee (LMC) wrote:
> I have a small conceptual problem. I have been
>told that doing:
>
>my $item;
>foreach $item (@arr) { ... }
>
>is more efficient than:
>foreach my $item (@arr) { ... }
Even if it is, this is the wrong thing to optimize for. If you'r
On Jun 7, Paul said:
>--- "Robin Lavallee (LMC)" <[EMAIL PROTECTED]> wrote:
>> Then can someone explains why the following code:
>>
>> #---Begin Code---
>> use strict;
>> my $par="50";
>> print "$par\n";
>>
>> my @arr = ('first', 'second', 'third');
>> foreach $par (@arr)
>> {
>> print "$p
--- "Robin Lavallee (LMC)" <[EMAIL PROTECTED]> wrote:
> Then can someone explains why the following code:
>
> #---Begin Code---
> use strict;
> my $par="50";
> print "$par\n";
>
> my @arr = ('first', 'second', 'third');
> foreach $par (@arr)
> {
> print "$par\n";
> }
> print "$par\n";
> #
--- "Robin Lavallee (LMC)" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have a small conceptual problem. I have been
> told that doing:
>
> my $item;
> foreach $item (@arr) { ... }
>
> is more efficient than:
> foreach my $item (@arr) { ... }
>
> Because it does not reallocate memory each