If you don't mind the extra step of removing the trailing comma then a hash should work:
my %hash; while ( <> ) { my ( $dept, $email ) = split /:/; $hash{ $dept } .= "$email,"; } s/,\z// for values %hash;
In reply to Re: Best Way to Map Data
by jwkrahn
in thread Best Way to Map Data
by walkingthecow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |