#!/usr/bin/perl use strict; use warnings; use List::Util qw(sum); my @list_of_numbers = ( 1 .. 50 ); my $i = (); my $a = (); sub mean { return sum(@_) / @_; } sub above_mean { $i == mean(@list_of_numbers); foreach (@list_of_numbers) { if ( $a > $i ) { print "$a is above mean, which is mean(@list_of_numbers)"; } print above_mean(@list_of_numbers);
In reply to Re: [Homework Question] Subroutines & References
by toolic
in thread [Homework Question] Subroutines & References
by Hayest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |