use strict; use Data::Dumper; # original data my @status = ( "Applied", "Enrolled", "Admitted", "Applied", "Enrolled" ); # count keys my %tmphash = (); $tmphash{$_}++ for ( @status ); # convert into an array, as requested my @statuscount = %tmphash; # display print( Data::Dumper::Dumper( \@statuscount ) );