in reply to Re^2: Reading a file with 8kB long lines
in thread Reading a file with 8kB long lines

You can't set the input delimeter unless you know more than you've told us about comment lines.

I'd do something like:

my $full_line = ''; while ( my $line = <FH> ) { chomp $line; next if substr( $line, 0, 2 ) eq '//'; $full_line .= " $line"; # space wanted? your call! next unless substr( $line, -1, 1 ) eq ';'; #do something with $full_line print "$full_line\n"; $full_line = ''; }
Update: replace the $full_line .= line with

$full_line .= $full_line eq '' ? $line : " $line";

Update^2: I should have said this has been tested and produced the following with your sample data:

some code; more code; some very long long long code;