Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Anonymous hash of arrays

by choroba (Cardinal)
on Jan 21, 2015 at 09:45 UTC ( [id://1114002]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1114002]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found