Skip to content

Instantly share code, notes, and snippets.

@binaryfever
Created June 10, 2011 18:11
Show Gist options
  • Save binaryfever/1019389 to your computer and use it in GitHub Desktop.
Save binaryfever/1019389 to your computer and use it in GitHub Desktop.
Case insensitive PERL sorting
#!/usr/bin/perl
#Small example script just because I keep forgetting how to do case-insensitive sorting on an array in PERL.
@values = qw(fred trevor Burt steve Greg Alcedine);
@sorted_values = sort { "\L$a" cmp "\L$b" } @values;
print "@sorted_values\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment