in reply to Re: Check array for several matches
in thread Check array for several matches

The surrounding box-brackets [ ] convert the previously returned list into an ARRAY reference, and the @{ } construct converts the ARRAYref into an array. This is necessary because an array is different from a list. A list does not return the number of elements it contains in scalar context, but an array does, ...

While all of that is correct, note that grep in scalar context returns the number of times the expression was true, so the @{ [ ... ] } isn't necessary:

print "do stuff\n" if @required == grep { defined } @hash{@required};