in reply to using split on a file

You should also be able to turn off what perl considers a newline by setting
$/ = undef;
Now you can
$string = <FILE>; #since $/ is off, everything #gets slurped into $string @array = split /%%%%\n/m, $string; #now we just split on #the appropriate delimiter, carriage #return included