List::UtilsBy 

use List::UtilsBy       qw( count_by );
use Proc::ProcessTable  qw();
use Data::Dumper        qw( Dumper );

my $procs = Proc::ProcessTable->new->table;

my %tally = count_by { scalar getpwuid($_->uid) } @$procs;

say Dumper(\%tally);