or to be nearer to what he/she wanted to do just:

while ($i < 0.8) {
 #do something which changes $i 
}

"Dr.Ruud" <[EMAIL PROTECTED]> hat am 10. Oktober 2008 um 11:27 geschrieben:

> Rob Dixon schreef:
> > anilfunde
> 
> >>   for($i=0;$i<0.8;$i=$i+0.1)
> >>      {
> >>         print "$i\n";
> >>     }
> > 
> > The correct way to write this is
> > 
> >   for (0 .. 8) {
> >     my $i = $_/8;
> >     print "$i\n";
> >   }
> 
> 
> YM /10. 
> 
> Alternative:
> 
>    for my $p (0 .. 8) {
>      printf "%.1f\n", $p / 10;
>    }
> 
> -- 
> Affijn, Ruud
> 
> "Gewoon is een tijger."
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
> 
>

Reply via email to