in reply to using split on a file

How about: @list = split /^%{5}$/m, <FILE>