i want to sort an array for certain key words first and then alphabetically.

my @foo = qw/foo bar baz first second third/;

foreach my $i (sort {$a cmp $b} @foo) {
  print "$i\n";
}

How do I make 'first', 'second', and 'third' come before the rest?
(I'm actually dealing with a hash)

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to