Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
John W. Krahn wrote:
my() happens when the code is compiled so it is *not* re-run every
time through the loop. The assignment happens when the code is run
so it is re-run every time.
$ perl -e '
for (1..5) {
my $count;
$count += 1;
print $count;
last if $count == 3;
}
print "\n";
'
11111
I don't understand what you are trying to demonstrate with that code?
That my() also happens at run-time,
And how does your code demonstrate that?
just as the last sentence in the
docs quote you posted a few minutes ago says. (I hadn't seen that post
when I posted.)
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/