sub check_quota { my $hash_ref=shift; my (@users,@list); my %hash; #print Dumper($hash_ref); for my $user (keys %$hash_ref) { push(@users, $user); } my @repq_h=grep { #print $_,"\n"; if($_ =~ m{^([A-Za-z0-9]+)}) { my $word=$1; push(@{$hash{$word}},$_); grep $word,@users; } } qx{repquota -a}; print Dumper(\@repq_h); }