my %mountpoints; my @mountpoints; for (qw(foo bar bar foo baz)) { push @mountpoints, $_ unless $mountpoints{$_}++; }