Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^3: Counting Data in two columns?

by neniro (Priest)
on Jun 15, 2006 at 14:00 UTC ( #555502=note: print w/replies, xml ) Need Help??

in reply to Re^2: Counting Data in two columns?
in thread Counting Data in two columns?

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hoa = ( flintstones => [ "fred", "barney" ], jetsons => [ "fred", "jane", "elroy" ], simpsons => [ "homer", "marge", "bart" ], ); my @freds = grep { $hoa{$_}->[0] eq 'fred' } sort keys %hoa; print Dumper \@freds;

Replies are listed 'Best First'.
Re^4: Counting Data in two columns?
by sdslrn123 (Novice) on Jun 16, 2006 at 21:51 UTC
    Thank You. But is grep an unix command? Unfortunately, I do not use Unix?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://555502]
[FloydATC]: Is CPAN down?!?
[FloydATC]: I get a 404 for
[FloydATC]: perl -MCPAN and the cpan command uses
[FloydATC]: I was able to download and install what I needed manually, that's not the issue

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-01-24 08:13 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (256 votes). Check out past polls.