in reply to while loop not working

If all you want to do is capture all lines that aren't blank and don't containt POLYMORPH, then just tell perl to do that:

my @data; while( <IN> ) { chomp; push @data, $_ unless /^\s*$/ or /^POLYMORPH/; }

Using Data::Dumper this gave me:

$VAR1 = [ 'C 1, 1( 9)', 'C 2, 2(11)', 'R 2, 2(18)', 'C 1, 1( 4)', 'C 2, 2(18)', 'C 1, 1( 4)', 'R 2, 2(18)', 'C 1, 1( 9)', 'C 2, 2(18)', 'C 1, 1( 9)', 'R 2, 2( 8)', 'C 1, 1( 0)', 'C 1, 1( 0)', 'C 1, 1( 9)', 'C 2, 2(18)' ];

You may want something more complex than that...

--
"To err is human, but to really foul things up you need a computer." --Paul Ehrlich