sub file_merge { my $hash_ref = shift; while (<>) { chomp; my ($key, @values) = split /-/, $_; push @{$hash_ref->{$key}}, [ @values ]; } }