my %arrays; $tmp =~ /(.+)(\d+)$/; $arrays{$1}->[$2] = 'some value';