Created
August 20, 2014 05:14
-
-
Save libitte/3047ebd64baa3a6d48cc to your computer and use it in GitHub Desktop.
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/env perl | |
| use strict; | |
| use warnings; | |
| use Data::Dumper; | |
| local $Data::Dumper::Indent = 1; | |
| local $Data::Dumper::Terse = 1; | |
| my @array = qw(goo bar buzz jri jri jri buzz); | |
| my %hash; | |
| my @ret = grep {!$hash{$_}++} @array; | |
| print Dumper \@ret; | |
| __END__ | |
| [ | |
| 'goo', | |
| 'bar', | |
| 'buzz', | |
| 'jri' | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment