in reply to Re^4: How to pass --MORE--
in thread How to pass --MORE--

@lines = grep is_empty($_), @lines;

Where is_empty depends of your definition of empty. For instance:

sub is_empty { my $line = shift; $line eq '' }

BTW, even if you may still be facing the same issue, this is a different question. You should open a new thread for it.