C for statement version in Perl

Discussion in 'Perl' started by Kelly, Jun 18, 2004.

  1. Kelly

    Kelly Guest

    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
    Kelly, Jun 18, 2004
    #1
    1. Advertising

  2. 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
    Jürgen Exner, Jun 19, 2004
    #2
    1. Advertising

  3. Kelly

    Purl Gurl Guest

    Purl Gurl, Jun 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    787
  2. V Green
    Replies:
    0
    Views:
    824
    V Green
    Feb 5, 2008
  3. PA Bear [MS MVP]
    Replies:
    0
    Views:
    929
    PA Bear [MS MVP]
    Feb 5, 2008
  4. MowGreen [MVP]
    Replies:
    5
    Views:
    1,993
    PA Bear [MS MVP]
    Feb 9, 2008
  5. Francesco Moi
    Replies:
    1
    Views:
    166
    Sisyphus
    Jul 27, 2003
Loading...

Share This Page