diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-27T15·28-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-27T15·28-0400 |
commit | 8b8fe6139e05f990b9d2a35652fd9bdb79189f90 (patch) | |
tree | 705277bd75e337c87801c343094134e5b3645a7b /perl | |
parent | babe54bf97091441353f2219e7846afd0e0d9f16 (diff) |
Drop dependency on List::MoreUtils
Diffstat (limited to 'perl')
-rw-r--r-- | perl/lib/Nix/Utils.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perl/lib/Nix/Utils.pm b/perl/lib/Nix/Utils.pm index 943b8dd4abfa..1e7e0b5afb2f 100644 --- a/perl/lib/Nix/Utils.pm +++ b/perl/lib/Nix/Utils.pm @@ -6,3 +6,14 @@ sub checkURL { my ($url) = @_; die "invalid URL ‘$url’\n" unless $url =~ /^ $urlRE $ /x; } + +sub uniq { + my %seen; + my @res; + foreach my $name (@_) { + next if $seen{$name}; + $seen{$name} = 1; + push @res, $name; + } + return @res; +} |