收益匪浅。谢谢哈 ^_^
----- Original Message -----
From: "perlw01f" <[email protected]>
To: "PerlChina Mongers 讨论组" <[email protected]>
Sent: Saturday, November 07, 2009 11:01 AM
Subject: [PerlChina] Re: 请教哈:将文件中重复的行,替换,只保留一行
>
> sub omit_dupli () {
> my @array = @_;
> my %count;
> my @unique = grep { ++$count{$_} < 2 } @array;
> return @unique;
> }
> >
>
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。
要在此论坛发帖,请发电子邮件到 [email protected]
要退订此论坛,请发邮件至 [email protected]
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---