in reply to When is an ^$ not a ^$ ?

Don't make things harder than they have to be! Just do this:
open (FILE,"<$input_file") or die "Couldn't open file $input_file, $!\ +n"; while (<FILE>) { chomp; if ($_) { $entry .= "$_\n"; } else { push @data, $entry; $entry = ""; } } close FILE;

Replies are listed 'Best First'.
Re: Re: When is an code^$/code not a code^$/code?
by Clownburner (Monk) on Apr 05, 2001 at 06:02 UTC
    I dunno about this. When I tried it that way, the first blank line I hit knocked me out of my while loop...
    Signature void where prohibited by law.