perl -MData::Dump -lane "$HoA{$F[0]} = [ @F[1..$#F] ]; END{dd %HoA}" exampledata.txt ( "A", ["another", "awesome", "awful"], "E", ["example", "estinguished"], )