On Tue, 29 Jan 2002 21:56:38 -0600, Michael Pratt wrote:
> What is the simplest means of reading a text file line by line.

#!/usr/bin/perl -w
use strict;

open(FILE, '< file.txt') or die "Cannot open file: $!\n";

while(<FILE>){  # Read each line of file.txt until end of file.
        # the current line content is in $_
        print "Current line: $_";
}

__END__

-- 
briac
 << dynamic .sig on strike, we apologize for the inconvenience >>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to