On Tue, 30 Mar 2010 23:05:00 -0600
Jon Forsyth wrote:
> I am truly a beginner. Could someone help me understand this syntax
> out of a code example from "Learning Perl"? On line 5 I'm confused
> as to why "my $number" is between "foreach" and the ()? is "my
> $number part of the loop?
Yes, it
Uri Guttman wrote:
> > "TB" == Thomas Bätzler writes:
> TB> with the -w switch or the "use warnings;" pragma which requires
> TB> variables to be declared before their first use.
>
> that is the use strict pragma, not the warnings one.
Of course. I knew I shouldn't have posted befor
> "TB" == Thomas Bätzler writes:
TB> Jon Forsyth asked:
>> I am truly a beginner. Could someone help me understand this syntax
>> out of a code example from "Learning Perl"? On line 5 I'm confused
>> as to why "my $number" is between "foreach" and the ()? is "my
>> $number part
Jon Forsyth asked:
> I am truly a beginner. Could someone help me understand this syntax
> out of a code example from "Learning Perl"? On line 5 I'm confused
> as to why "my $number" is between "foreach" and the ()? is "my
> $number part of the loop?
"my" declares a variable for the lexical sc
I am truly a beginner. Could someone help me understand this syntax out of
a code example from "Learning Perl"? On line 5 I'm confused as to why "my
$number" is between "foreach" and the ()? is "my $number part of the loop?
sub running_sum {
state $sum = 0;
state @numbers;
foreach my $