#!/bin/env perl use strict; use warnings; use 5.010; my %info; while (my $line = ) { chomp $line; if ($line =~ /##INFO= ', join(',', @{$info{$header}}); } __DATA__ # First the headers ##INFO=