@_ can't be a numeric value. It's an array. I think you want to check that each element of
@_ is a numeric value. So check each element of
@_ in turn. If you find one that isn't numeric, return undef. Otherwise, proceed with your calculations.
PS - Sorting to find the highest value doesn't scale as well as simply checking each value in turn to see if it's higher than the highest one seen to date.
PPS - Your prof could have used Scalar::Util's looks_like_number rather than using fatal warnings and eval. His solution doesn't even work in all circumstances. (Specifically, objects that numify to undef.)