Eduardo Vázquez Rodríguez wrote:
Hello Perl Programmers
Hello,
I have a question regarding openning a file
How can I start reading a file from n line?
For example
I open a File like this way
open(INPUT, $file)
while (<INPUT>)
{
do something with $_;
}
But It starts to read from line #1, what I want is that start reading
exactly from line 10.
Read the first nine lines before the while loop:
open INPUT, $file or die "Cannot open $file: $!";
# get rid of first nine lines
<INPUT> for 1 .. 9;
while ( <INPUT> ) {
do something with $_;
}
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>