in reply to problem with evaluating first line in a file

What would you like to happen?

  • Comment on Re: problem with evaluating first line in a file

Replies are listed 'Best First'.
Re^2: problem with evaluating first line in a file
by baxy77bax (Deacon) on Mar 09, 2009 at 15:23 UTC
    "Drop empty records, without incrementing the id" would be ideal but it really doesn't matter , because first id is a random number anyway.
      my $line; while(<LINES>){ if (m/^--/){ if (defined($line)){ my @data = ( [ $id++, $line ] ); $self->_loaddb(table => 'TABLE', data => \@data); $line = undef; } } else{ chomp; $line .= $_; } }