in reply to Re: Re: Re: What Is Going On Here ?????
in thread What Is Going On Here ?????

Um this isn't exactly true... Run this... $_ isn't GLOBAL, it is LOCALized automatically. The inner and outer loops each have their own $_ but the "current" $_ is still in scope in the supbroutine called...
#!/usr/bin/perl -w use strict; my @l=qw( a b 3 d ); foreach (@l) { print "$_ = "; foreach (@l) { print "$_ "; } print "\n"; } foreach (@l) { icky(); } sub icky { print "$_ = "; foreach (@l) { print "$_ "; } print "\n"; }

You don't need to local($_) inside a foreach loop.

--
$you = new YOU;
honk() if $you->love(perl)