Jason Balicki wrote:
Eduardo Vázquez Rodríguez <mailto:[EMAIL PROTECTED]> wrote:

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 $_;
}


I'm a newbie myself, but is there a reason you've
already discounted something like:

my linecount=1;
open (INPUT, $file);
while (<INPUT>){
        if ($linecount >= 10) {
                do something;
        }
        $linecount++;
}

You could use the built-in $. variable for that:

while ( <INPUT> ) {
    next if 1 .. 9;
    do something;
    }



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>




Reply via email to