while (<>) { print if /^\*+$/ ... /^\*+$/ and not /^\*+$/; }