On Thu, 26 Feb 2009 15:34:11 -0500 Rick <rich.j...@gmail.com> wrote: > trying out getting lasrgest key(by value) but below is not working... > > help please. > > my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" > =>"997", "forever" =>"100001", "five" =>"5"}}; > my $max; > print join(" ",keys %files),"\n"; > > =pod > grep($max=($files{$_} > $max )? $_ : $max,keys %files); > =cut > for my $jot (keys %files) { > print "$jot $files{$jot}\n"; > } > > for my $now (keys %files) { > $max = $now if $now > $max; > } > > > print "<$max>\n"; >
What happens if you put this at the top of your program use strict; use warnings; use diagnostics; ? Owen -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/