View Single Post
Old 10-10-2001, 02:33 PM  
Tuzz
Confirmed User
 
Join Date: Aug 2001
Location: Sunny Florida
Posts: 171
There are lots of ways...here's one off the cuff

my $linecount = 0;
open FILE,"<file.txt" &#0124;&#0124; die "Unable to open file: $!";
my @lines = <FILE>;
close(FILE);
my $line;
foreach $line(@lines) {
$linecount++;
while ($linecount<2) {
print "$line";
}
}

should work in most contexts.
Tuzz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote