Re: why Perl complaints my script
- From: chen_li3@xxxxxxxxx (Chen Li)
- Date: Thu, 28 Sep 2006 08:18:10 -0700 (PDT)
Thank you very much,
Li
--- Igor Sutton <igor.sutton@xxxxxxxxx> wrote:
15
for ($k; $k>=1;$k--) {$result*=$n--;}#line
You don't need to declare $k inside for (). Change
that to
for (; $k >= 1; $k--)
and perl won't complain about it anymore. I think
the place before the first
';' is used for declaring any variables inside the
lexical scope of for.
Maybe someone could explain this better?
--
Igor Sutton Lopes <igor.sutton@xxxxxxxxx>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.
- References:
- Re: why Perl complaints my script
- From: Igor Sutton
- Re: why Perl complaints my script
- Prev by Date: Re: why Perl complaints my script
- Next by Date: Re: why Perl complaints my script
- Previous by thread: Re: why Perl complaints my script
- Next by thread: Re: why Perl complaints my script
- Index(es):
Relevant Pages
|