#!/usr/bin/perl -w
use strict;

# Provide a declaration without a prototype:
sub anothasub;
my @arr = (1, 2, 10);
my $x=10, my $y=23;

print "Sum=" . anothasub(@arr) . "\n" ;
print "Sum=" . anothasub(6, 8, 2, 4, 0) . "\n" ;
print "Sum=" . anothasub($x, $y) . "\n" ;

sub anothasub {
    my $sum=0; my $count=0;
#    for my $i (@_) { $sum += $i; }
    for (@_) { $sum += $_; $count++ }
    return ($sum / $count);
}
