I need to read in a file of 200 lines and print each out to a separate 
file.

I've been stumbling with this, but I don't know how to name each outfile 
individually.  I was hoping to see 200 files named tx1 - tx200, but 
instead I get tx1234..................... for 123 files and then it dies.  
Help?

==
#!/usr/bin/perl

use strict;
use warnings;

my $i = 0;
my $outfile = "tx";

open( INFILE, "speed_test.csv" );

        while( <INFILE> ) {
                open( OUTFILE, "> $outfile" );
                print OUTFILE "$_\n";
                close OUTFILE;
                $outfile = $outfile.$i++;
        }
==


------------------------------------------------------------------------
Charles Farinella 
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
cfarine...@appropriatesolutions.com
voice: 603.924.6079   fax: 603.924.8668


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to