Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Need to get hash of arrays

by BillKSmith (Monsignor)
on May 14, 2021 at 12:51 UTC ( #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? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2021-11-27 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?