[oak perl] until loop(s)
David Alban
extasia at gmail.com
Mon Mar 28 14:09:14 PST 2005
Aieeeeee!
Testing, boys and girls. Testing will save your behind.
(Thanks, Steve.)
On Mon, 28 Mar 2005 13:49:11 -0800, Steve Fink <sfink at reactrix.com> wrote:
> > my $counter;
> > for $counter ( 1..5 ) {
> > ...
> > }
> >
> > if $counter was needed after the loop.
>
> But not if the __value__ is needed after the loop, because 'for' will
> implicitly localize the value.
>
> my $counter = 10;
> for $counter (1..5) {
> }
> print $counter;
>
> will print 10.
--
Live in a world of your own, but always welcome visitors.
More information about the Oakland
mailing list