Re: why Perl complaints my script



Thank you very much,

Li

--- Igor Sutton <igor.sutton@xxxxxxxxx> wrote:


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>



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.



Relevant Pages

  • Re: Performance 4.x vs. 6.x
    ... not so rare anymore. ... better my 5.5 SMP apache are not that bad ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (freebsd-performance)
  • Re: perl scalar
    ... then you'll need to declare it with my. ... On 9/20/06, elite elite wrote: ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • Re: fc5: install everything?
    ... It is not there anymore! ... Antonio ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (Fedora)
  • sunscreen notes
    ... Solaris 8/9. ... Do you Yahoo!? ... Declare Yourself - Register online to vote today! ...
    (Security-Basics)
  • sunscreen notes
    ... Sunscreen on Solaris 8/9. ... Do you Yahoo!? ... Declare Yourself - Register online to vote today! ...
    (Security-Basics)