in reply to help with split into array

Recycling my answer from here

To build a hashe of arrays , you need to store, arrayrefs in the hash, like this

#!/usr/bin/perl -- use strict; use warnings; my %foo; my @bar; $foo{bar}=\@bar; $foo{BAR}=\@bar; for ( 1 .. 2){ my @arr = "ab$_" .. "ab4"; $foo{$_} = \@arr; } use Data::Dumper; print Dumper( \%foo ); __END__ $VAR1 = { '1' => [ 'ab1', 'ab2', 'ab3', 'ab4' ], 'bar' => [], 'BAR' => $VAR1->{'bar'}, '2' => [ 'ab2', 'ab3', 'ab4' ] };

See the \ operator takes a reference, to an array (\@array), to a hash (\%hash), to a scalar (\$scalar)

See Tutorials: References quick reference