And now for something completely different...
#!/usr/bin/perl # http://perlmonks.org/?node_id=1191833 use strict; use warnings; my @x=qw/d b c e a f/; my @y=qw/4 6 5 2 9 1/; my @answer; @answer[@y] = @x; @answer = (grep defined, reverse @answer)[0..3]; print "@answer\n";
In reply to Re: How can I get the four highest valued letters in an array?
by tybalt89
in thread How can I get the four highest valued letters in an array?
by supriyoch_2008
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |