Re: why Perl complaints my script

2006-09-28 Thread chen li
Hi Andriano, Thank you very much, Li --- Adriano Ferreira <[EMAIL PROTECTED]> wrote: > On 9/28/06, chen li <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I write a small script for permutation. When I use > > version 1) Perl always complaint it although I get > the > > result. If I use version

Re: why Perl complaints my script

2006-09-28 Thread chen li
Thank you very much, Li --- Igor Sutton <[EMAIL PROTECTED]> 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 b

Re: why Perl complaints my script

2006-09-28 Thread chen li
Thanks, Li --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > chen li schreef: > > > for ($k; $k>=1;$k--) {$result*=$n--;} > > Alternative: > > $result *= $n-- for 1..$k ; > > -- > Affijn, Ruud > > "Gewoon is een tijger." > > > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additio

Re: why Perl complaints my script

2006-09-28 Thread Dr.Ruud
chen li schreef: > for ($k; $k>=1;$k--) {$result*=$n--;} Alternative: $result *= $n-- for 1..$k ; -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: why Perl complaints my script

2006-09-28 Thread Adriano Ferreira
On 9/28/06, chen li <[EMAIL PROTECTED]> wrote: Hi all, I write a small script for permutation. When I use version 1) Perl always complaint it although I get the result. If I use version 2) it never says a word about it. Any comments? Perl always complain (provided you called for that with -w o

Re: why Perl complaints my script

2006-09-28 Thread Igor Sutton
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 s