Created
June 10, 2011 18:11
-
-
Save binaryfever/1019389 to your computer and use it in GitHub Desktop.
Case insensitive PERL sorting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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