# Entry 1 ... # Entry 2 ... #### perl -pe 'BEGIN { $/ = "#" } exit if $. > 500' input-file