Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > C for statement version in Perl

Reply
Thread Tools

C for statement version in Perl

 
 
Kelly
Guest
Posts: n/a
 
      06-18-2004
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

 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      06-19-2004
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


 
Reply With Quote
 
 
 
 
Purl Gurl
Guest
Posts: n/a
 
      06-19-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM
How do I do a conditional statement in a constant statement? tkvhdl@gmail.com VHDL 3 12-16-2005 06:13 PM
Perl lib version (v5.6.0) doesn't match executable version (v5.8.0) Francesco Moi Perl Misc 1 07-27-2003 01:45 PM



Advertisments