use warnings; use strict; my %shell; while ( my ($ui) = ( getpwent() )[8] ) { $shell{$ui}++; } print $shell{$_}, ' person(s) uses ', $_, $/ for keys %shell;