use mapcar; mapcar { $_[0]{$_[1]}++ } [\%user,\%group], [(stat $file)[4,5]];