in reply to Re: Required guidance to simplify this program
in thread Required guidance to simplify this program
Using grep and map in a void context is generally discouraged. A for statement modifier is usually clearer, and almost always faster.
use strict; use warnings; use Data::Dumper; my @array = qw(John Sue Larry Mary John Mary Larry John Joe Lisa John +Mary); my %count; $count{$_}++ for @array; print Dumper \%count;
|
|---|