Re: why Perl complaints my script




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>


Relevant Pages

  • Re: Could it be?
    ... if they fight back they are ... anymore and says what they want. ... more reason than to complain. ...
    (rec.music.beatles)
  • Re: {OT} Dems Target Private Retirement Accounts
    ... anymore. ...  I think you like to talk and complain but never take action. ... Nancy Pelosi out of Congress. ... "I am not a friend to a very energetic government. ...
    (alt.autos.toyota)
  • Re: {OT} Dems Target Private Retirement Accounts
    ... anymore. ... I think you like to talk and complain but never take action. ... Nancy Pelosi out of Congress. ... "I am not a friend to a very energetic government. ...
    (alt.autos.toyota)
  • Re: OT: GNU libc linking problem on Linux
    ... Tor Rustad wrote: ... people complain that "my" code don't build anymore, ... Ian Collins. ...
    (comp.lang.c)
  • Re: MLB opinions wanted
    ... Now I don't have to hear you complain about your reception ... anymore. ... Prev by Date: ...
    (rec.radio.shortwave)