Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Need to get hash of arrays

by BillKSmith (Monsignor)
on May 14, 2021 at 12:51 UTC ( [id://11132589]=note: print w/replies, xml ) Need Help??


in reply to Need to get hash of arrays

The Command Switches -a, -F, and -n do most of the work.
#!perl -aF/\|/ -n use strict; use warnings; our %hash; push @{$hash{$F[0]}}, $F[1]; END{ use Data::Dumper; print Dumper(\%hash); }
Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found