Created
February 6, 2014 07:23
-
-
Save satomixx/8839670 to your computer and use it in GitHub Desktop.
Perlで2つの配列の要素から重複を排除する、重複した要素だけ抽出する ref: http://qiita.com/mugyuu/items/f5d825c5214a7848305a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hoge# perl make_array_unique .pl | |
6 | |
2 | |
8 | |
4 | |
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@unique = grep { $count{$_} >= 2 } keys %count; # 要素数が2より小さいもののみ抽出 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment