in reply to Record separator question

If you define

{ local $/ = '===='; open local(*FILE1), '<', shift or die $!;
then you can discard a first (empty) read, and get the header info and data in two further reads,
local $_ = <FILE1>; while (<FILE1>) { my @header_data = header_extract($_); my $data = <FILE1>; # second read my @data = data_extract($data); # ... } close DATA1 or die $!; redo if @ARGV; }

After Compline,
Zaxo