配列の中の重複した値を削除[perl]
2行でできる#!/usr/bin/perl use strict; use warnings; my @array = ('aaa', 'bbb', 'ccc', 'aaa'); my %count; @array = grep {!$count{$_}++} @array; foreach my $element (@array) { print "$element\n"; }my %count; @array = grep {!$count{$_}++} @array;参考:http://troubledkumi.blog85.fc2.com/blog-entry-5.html