diff options
Diffstat (limited to 'perl/lib/Nix')
-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; +} |