Skip to content

Instantly share code, notes, and snippets.

@libitte
Created August 20, 2014 05:14
Show Gist options
  • Select an option

  • Save libitte/3047ebd64baa3a6d48cc to your computer and use it in GitHub Desktop.

Select an option

Save libitte/3047ebd64baa3a6d48cc to your computer and use it in GitHub Desktop.
#!/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