Re: why Perl complaints my script
- From: igor.sutton@xxxxxxxxx (Igor Sutton)
- Date: Thu, 28 Sep 2006 10:06:23 -0300
for ($k; $k>=1;$k--) {$result*=$n--;}#line 15
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>
- Follow-Ups:
- Re: why Perl complaints my script
- From: Chen Li
- Re: why Perl complaints my script
- References:
- why Perl complaints my script
- From: Chen Li
- why Perl complaints my script
- Prev by Date: why Perl complaints my script
- Next by Date: Re: interpoliation within regexp
- Previous by thread: why Perl complaints my script
- Next by thread: Re: why Perl complaints my script
- Index(es):
Relevant Pages
|