Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl (http://www.velocityreviews.com/forums/f17-perl.html)
-   -   C for statement version in Perl (http://www.velocityreviews.com/forums/t25139-c-for-statement-version-in-perl.html)

Kelly 06-18-2004 08:11 PM

C for statement version in Perl
 
Hi,

I want to do this, in C, this is how to do it

for (i=0;i<4000;i++)
.....write to a file...
.....

is there a function to write 4000 times to a file
in perl?

Thanks.

kel


Jürgen Exner 06-19-2004 07:05 AM

Re: C for statement version in Perl
 
Kelly wrote:
> I want to do this, in C, this is how to do it
>
> for (i=0;i<4000;i++)
> ....write to a file...
> ....
>
> is there a function to write 4000 times to a file
> in perl?


1) Exactly the same code will work in Perl, too.
2) The more perlish style would be
for my $i (0..3999) { write to a file}

jue



Purl Gurl 06-19-2004 03:40 PM

Re: C for statement version in Perl
 
Kelly wrote:

> is there a function to write 4000 times to a file
> in perl?



print "write to a file\n" x 4000


Purl Gurl
--
Most Entertaining Android In Existence!
http://www.purlgurl.net/~callgirl/roberta/roberta.cgi


All times are GMT. The time now is 12:34 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.