On December 14, 2003 03:09 pm, John W. Krahn wrote:
> Fred Nastos wrote:
> > On December 14, 2003 01:21 pm, km wrote:

> > How about the old-fashioned way?
> >
> > for ($i=1; $i<=10) {
> >         print $i, "\n";
> >         $i = $i + 3;
> > }
>
> That produces a syntax error, it won't run.

Really!? Opps. Yes, I made a typo.  I forgot a semi-colon (next time I will 
cut-and-paste!). The following should work:

#!/usr/bin/perl -w
for ($i=1; $i<=10;) {
    print $i, "\n";
    $i = $i + 3;
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to