while ($$buffref =~ s/([^\n]+)\n//) { print "$1\n"; $$buffref =~ s/^\n//; }