sub median_num{
my @sorted= @_; #using shift didn't work, why? format?
&debug::debugdumplist("median_num(): \@sorted", \@sorted);
####
D:\PerlMonks>shift3.pl
Using a hash as a reference is deprecated at D:\PerlMonks\shift3.pl line 54.
median_num(): @sorted (S:/Steve/Perl/debug.pm:887):
[ARRAY(0x2ae0c28)]
[1]
[1]
[2]
[3]
[3]
[3]
[3]
[4]
[5]
[7]
[8]
[12]
[12]
[23]
[25]
[32]
[33]
[42]
[43]
[43]
[44]
[55]
mean : 18.3636363636364
length : 22
median_num(): @sorted (S:/Steve/Perl/debug.pm:887):
[1]
[1]
[2]
[3]
[3]
[3]
[3]
[4]
[5]
[7]
[8]
[12]
[12]
[23]
[25]
[32]
[33]
[42]
[43]
[43]
[44]
[55]
this is median : 12
this will be middle num position : 11.5
this is length :22
Use of uninitialized value in concatenation (.) or string at D:\PerlMonks\shift3.pl line 29.
1 1 2 3 3 3 3 4 5 7 8 12 12 23 25 32 33 42 43 43 44 55
D:\PerlMonks>
####
my ($middle,$median)=median_num(@new_sort);
median_num(\@sorted);