in reply to Delete last line of file with regex
while (<>) { print unless /^##/ && eof; } [download]