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;
In reply to Re^2: Required guidance to simplify this program
by tobyink
in thread Required guidance to simplify this program
by vyeddula
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |