The stupid question is the question not asked | |
PerlMonks |
Re: Passing Variablesby toolic (Bishop) |
on Feb 25, 2021 at 21:12 UTC ( [id://11128801]=note: print w/replies, xml ) | Need Help?? |
The problem is in your above_average sub. Perl flattens everything passed into one list. So, your @_ also contains the $average passed in. You should first remove $average using shift. Also, you should explicitly return your @final_list array. Change it to:
For more details, see perlsub
In Section
Seekers of Perl Wisdom
|
|