Glen Lee Edwards wrote:
> open(FD,"$file") || die "Can not open $file";
>         while(<FD>) {
> 
>                 while ($line = <FD>)
> {
>                 print "lineNo is $. and text is $text\n";
> 
>                 next if ($. < $text);
>                 print $line;
> }
> }
> close FD;

I don't think that's going to work right.  For one, you will never hit
the first line.  The dual while loop isn't useful, and should be
eliminated.

Try:

open(FD,"$file") || die "Can not open $file";
while ($line = <FD>)
{
  # Is the following line necessary?
  # print "lineNo is $. and text is $text\n";
  next if ($. < $text);
  print $line;
}
close(FD);


MSG


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to