in reply to Anonymous hash of arrays

Use a hash of hashes (HoH):
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash; while (<>) { my @items = split /\|/; $hash{ $items[3] }{ $items[2] } = [ @items[0, 1, 4 .. $#items] ]; } print Dumper \%hash;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Anonymous hash of arrays
by packetstormer (Monk) on Jan 21, 2015 at 10:18 UTC

    Thanks, this is exactly what I need