my ($mode_num)=alt_mode_num(@data); print "Mode : $mode_num\n"; sub alt_mode_num{ my %count=(); for (sort{$a <=> $b} @_){ $count{$_}++; } my @key= sort{$count{$b}<=>$count{$a}} keys %count; #print " Key with highest value is $keys[0] \n"; return $key[0]; } #### my @num =(1..10); my @words = qw(hello world inside); function( {NUMBERS=>\@num, WORDS=>\@words} ); exit; sub function { die "no parameter!\n" unless @_; my %opt = %{ shift @_ }; my @i_words = $opt{WORDS}; print "this r words", Dumper \@i_words; my @i_numbers = $opt{NUMBERS}; print Dumper \@i_numbers; }