A while ago I had a weird problem on Perl for Windows. My program exited from while(<INPUT>) loop because of a character in the data file which was treated as EOF. After removing the character from the data file loop continued up to the very end. I didn't have time to investigate the problem and I can't say what the character was. Try to look at data where your loop is terminated.
Thank you, Vladimir --- Sisyphus <[EMAIL PROTECTED]> wrote: > > ----- Original Message ----- > From: "Howard Maher" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Wednesday, March 14, 2007 5:34 AM > Subject: Hitting a line limit while reading a file > > > >I was simply counting the number of lines in a 2 > gig file, printing to > >STDERR every 10,000 lines to indicate the program > was making progress, but > >the program stopped at 12,960,000 lines read... an > hour and a half later it > >still hadn't budged... > > What kind of memory issue could I have hit? > > This is a Windows 2000 box with 512 Meg of RAM. > > > > Code that was executing: > > > > open(INPUT,"$infilename") or die "couldn't open > $infilename for read, > > stopped at: $!"; > > my $line_num; > > while ( <INPUT> ) > > { > > $line_num++; > > print STDERR "$line_num\r" unless > $line_num%10000; > > } > > > > There's no need to count the lines yourself. The > special variable $. does > that for you. (See 'perldoc perlvar): > > while(<INPUT>) { > print STDERR "$.\r" unless $. % 10000; > } > > I don't know what the problem is, and I think it's > unlikely that change will > fix things. But it's something you could try. > > Cheers, > Rob > > > > _______________________________________________ > Perl-Win32-Users mailing list > [email protected] > To unsubscribe: > http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
