#!/usr/bin/perl -w use strict; use Data::Dumper; my ($field1, $field2); my %count; while (<DATA>) { chomp; ($field1, $field2) = split/\|/; push @{ $count{$field1} }, $field2; } print Dumper \%count; __DATA__ 10|10 20|20 30|30 10|100 15|15 50|50 15|150
In reply to Re: working with a hash
by FunkyMonk
in thread working with a hash
by semio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |