2009年5月9日星期六

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

这只是在那map当循环用。
不太合适。 

2009/5/9 Anthony WU <anthonywuy2k@gmail.com>
看來用map的人比較少
map ((/^(\d+)\|(\d+)$/, $hash{$1}+= $2), <>);
map (printf ("%d|%d\n", $_, $hash{$_}), keys (%hash));


-------- Original Message  --------
Subject: [PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加
From: Jacky Xu <x2x4com@gmail.com>
To: perlchina@googlegroups.com
Date: 9/5/2009 18:06
貌似浪费判断了,忘记undef可以在适合的时候自动转换成0了。  在 2009-05-09六的 18:02 +0800,Jacky Xu写道:   
1|2 1|3 2|3 3|3 4|3 4|4 1000000|1  use Data::Dumper;  my (%data,$key,$value); open F, "<20090508data"; while (<F>) {     chomp;     ($key,$value) = split /\|/;     if ( defined $data{$key} ) {         $data{$key} += $value;     } else {         $data{$key} = $value;     } }  print Dumper \%data ;      在 2009-05-08五的 21:13 +0800,li写道:     
先说一句,我不是来砸场子的^_^因为只会awk    cat 20090508data 1|2 1|3 2|3 3|3 4|3 4|4 1000000|1  cat analysis20090508data #!/bin/awk -f #Fri May  8 18:32:59 CST 2009  BEGIN { FS="|" }  {         array1[$1]+=$2 } END { #       n=asort(array1,dest)         print n"\n"         for(i in array1)         {         print i":"array1[i]         }         #print array1[1] }  使用: awk -f analysis20090508data 20090508data|sort -t: -k1n  结果:  1:5 2:3 3:3 4:7 1000000:1       2009/5/8 ☼ 林永忠 ☼ (Yung-chung Lin) <henearkrxern@gmail.com>:       
可以這樣寫  use Data::Dumper;  my %hash;  while (my $line = <STDIN>) {     my ($a, $b) = split /\|/, $line;     $hash{$a} += $b; }  print Dumper \%hash;   請參考  Best, Yung-chung Lin  2009/5/8 Gene <netgene@hotmail.com>         
怎样做效率高? 若域1相同的则进行合并,如下1|2和1|3合并成1|5: 1|2 1|3 2|3 3|3 4|3            
        
   

--  Best Regards, 	Anthony WU




--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

~$ cat data.txt
1|2
1|3
2|3
3|3
4|3

~$ perl -F'\|' -MData::Dumper -ane '$h->{$F[0]}+=$F[1];END{print Dumper $h}' data.txt
$VAR1 = {
          '4' => 3,
          '1' => 5,
          '3' => 3,
          '2' => 3
        };


:)

2009/5/9 agentzh <agentzh@gmail.com>
2009/5/9 Anthony WU <anthonywuy2k@gmail.com>

看來用map的人比較少
map ((/^(\d+)\|(\d+)$/, $hash{$1}+= $2), <>);
map (printf ("%d|%d\n", $_, $hash{$_}), keys (%hash));

呃。。。根据 perlstyle 文档,在 void 上下文下使用 map 要尽量避免:

   http://perldoc.perl.org/perlstyle.html

引用相关的一段:

    Avoid using grep() (or map()) or `backticks` in a void context, that is, when you just throw away their return values. Those functions all have return values, so use them. Otherwise use a foreach() loop or the system() function instead.

所以从内存效率上讲,在这里使用 map 是比较不划算的,呵呵,尤其当文件比较大的时候 ;)

Cheers,
-agentzh





--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

2009/5/9 Anthony WU <anthonywuy2k@gmail.com>
看來用map的人比較少
map ((/^(\d+)\|(\d+)$/, $hash{$1}+= $2), <>);
map (printf ("%d|%d\n", $_, $hash{$_}), keys (%hash));

呃。。。根据 perlstyle 文档,在 void 上下文下使用 map 要尽量避免:

   http://perldoc.perl.org/perlstyle.html

引用相关的一段:

    Avoid using grep() (or map()) or `backticks` in a void context, that is, when you just throw away their return values. Those functions all have return values, so use them. Otherwise use a foreach() loop or the system() function instead.

所以从内存效率上讲,在这里使用 map 是比较不划算的,呵呵,尤其当文件比较大的时候 ;)

Cheers,
-agentzh

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

看來用map的人比較少
map ((/^(\d+)\|(\d+)$/, $hash{$1}+= $2), <>);
map (printf ("%d|%d\n", $_, $hash{$_}), keys (%hash));

-------- Original Message  --------
Subject: [PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加
From: Jacky Xu <x2x4com@gmail.com>
To: perlchina@googlegroups.com
Date: 9/5/2009 18:06
貌似浪费判断了,忘记undef可以在适合的时候自动转换成0了。  在 2009-05-09六的 18:02 +0800,Jacky Xu写道:   
1|2 1|3 2|3 3|3 4|3 4|4 1000000|1  use Data::Dumper;  my (%data,$key,$value); open F, "<20090508data"; while (<F>) {     chomp;     ($key,$value) = split /\|/;     if ( defined $data{$key} ) {         $data{$key} += $value;     } else {         $data{$key} = $value;     } }  print Dumper \%data ;      在 2009-05-08五的 21:13 +0800,li写道:     
先说一句,我不是来砸场子的^_^因为只会awk    cat 20090508data 1|2 1|3 2|3 3|3 4|3 4|4 1000000|1  cat analysis20090508data #!/bin/awk -f #Fri May  8 18:32:59 CST 2009  BEGIN { FS="|" }  {         array1[$1]+=$2 } END { #       n=asort(array1,dest)         print n"\n"         for(i in array1)         {         print i":"array1[i]         }         #print array1[1] }  使用: awk -f analysis20090508data 20090508data|sort -t: -k1n  结果:  1:5 2:3 3:3 4:7 1000000:1       2009/5/8 ☼ 林永忠 ☼ (Yung-chung Lin) <henearkrxern@gmail.com>:       
可以這樣寫  use Data::Dumper;  my %hash;  while (my $line = <STDIN>) {     my ($a, $b) = split /\|/, $line;     $hash{$a} += $b; }  print Dumper \%hash;   請參考  Best, Yung-chung Lin  2009/5/8 Gene <netgene@hotmail.com>         
怎样做效率高? 若域1相同的则进行合并,如下1|2和1|3合并成1|5: 1|2 1|3 2|3 3|3 4|3            
         
      

--  Best Regards, 	Anthony WU

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

貌似浪费判断了,忘记undef可以在适合的时候自动转换成0了。

在 2009-05-09六的 18:02 +0800,Jacky Xu写道:
> 1|2
> 1|3
> 2|3
> 3|3
> 4|3
> 4|4
> 1000000|1
>
> use Data::Dumper;
>
> my (%data,$key,$value);
> open F, "<20090508data";
> while (<F>) {
> chomp;
> ($key,$value) = split /\|/;
> if ( defined $data{$key} ) {
> $data{$key} += $value;
> } else {
> $data{$key} = $value;
> }
> }
>
> print Dumper \%data ;
>
>
>
>
>
> 在 2009-05-08五的 21:13 +0800,li写道:
> > 先说一句,我不是来砸场子的^_^因为只会awk
> >
> >
> > cat 20090508data
> > 1|2
> > 1|3
> > 2|3
> > 3|3
> > 4|3
> > 4|4
> > 1000000|1
> >
> > cat analysis20090508data
> > #!/bin/awk -f
> > #Fri May 8 18:32:59 CST 2009
> >
> > BEGIN {
> > FS="|"
> > }
> >
> > {
> > array1[$1]+=$2
> > }
> > END {
> > # n=asort(array1,dest)
> > print n"\n"
> > for(i in array1)
> > {
> > print i":"array1[i]
> > }
> > #print array1[1]
> > }
> >
> > 使用:
> > awk -f analysis20090508data 20090508data|sort -t: -k1n
> >
> > 结果:
> >
> > 1:5
> > 2:3
> > 3:3
> > 4:7
> > 1000000:1
> >
> >
> >
> >
> >
> >
> > 2009/5/8 ☼ 林永忠 ☼ (Yung-chung Lin) <henearkrxern@gmail.com>:
> > > 可以這樣寫
> > >
> > > use Data::Dumper;
> > >
> > > my %hash;
> > >
> > > while (my $line = <STDIN>) {
> > > my ($a, $b) = split /\|/, $line;
> > > $hash{$a} += $b;
> > > }
> > >
> > > print Dumper \%hash;
> > >
> > >
> > > 請參考
> > >
> > > Best,
> > > Yung-chung Lin
> > >
> > > 2009/5/8 Gene <netgene@hotmail.com>
> > >>
> > >> 怎样做效率高?
> > >> 若域1相同的则进行合并,如下1|2和1|3合并成1|5:
> > >> 1|2
> > >> 1|3
> > >> 2|3
> > >> 3|3
> > >> 4|3
> > >>
> > >
> > >
> > > >
> > >
> >
> > > >


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

1|2
1|3
2|3
3|3
4|3
4|4
1000000|1

use Data::Dumper;

my (%data,$key,$value);
open F, "<20090508data";
while (<F>) {
chomp;
($key,$value) = split /\|/;
if ( defined $data{$key} ) {
$data{$key} += $value;
} else {
$data{$key} = $value;
}
}

print Dumper \%data ;

在 2009-05-08五的 21:13 +0800,li写道:
> 先说一句,我不是来砸场子的^_^因为只会awk
>
>
> cat 20090508data
> 1|2
> 1|3
> 2|3
> 3|3
> 4|3
> 4|4
> 1000000|1
>
> cat analysis20090508data
> #!/bin/awk -f
> #Fri May 8 18:32:59 CST 2009
>
> BEGIN {
> FS="|"
> }
>
> {
> array1[$1]+=$2
> }
> END {
> # n=asort(array1,dest)
> print n"\n"
> for(i in array1)
> {
> print i":"array1[i]
> }
> #print array1[1]
> }
>
> 使用:
> awk -f analysis20090508data 20090508data|sort -t: -k1n
>
> 结果:
>
> 1:5
> 2:3
> 3:3
> 4:7
> 1000000:1
>
>
>
>
>
>
> 2009/5/8 ☼ 林永忠 ☼ (Yung-chung Lin) <henearkrxern@gmail.com>:
> > 可以這樣寫
> >
> > use Data::Dumper;
> >
> > my %hash;
> >
> > while (my $line = <STDIN>) {
> > my ($a, $b) = split /\|/, $line;
> > $hash{$a} += $b;
> > }
> >
> > print Dumper \%hash;
> >
> >
> > 請參考
> >
> > Best,
> > Yung-chung Lin
> >
> > 2009/5/8 Gene <netgene@hotmail.com>
> >>
> >> 怎样做效率高?
> >> 若域1相同的则进行合并,如下1|2和1|3合并成1|5:
> >> 1|2
> >> 1|3
> >> 2|3
> >> 3|3
> >> 4|3
> >>
> >
> >
> > >
> >
>
> >


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

2009年5月8日星期五

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

2009/5/7 Beckheng Lam <bi.ken.lam@gmail.com>:
> A.有商业公司的强大支持
> B.有开源社区的强大支持
> C.有相关开源/商业产品的大量使用
> D.在中国有大量FANS
> E.时机未到
B和C
thanks, Perl,
thanks, Larry!

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

先说一句,我不是来砸场子的^_^因为只会awk


cat 20090508data
1|2
1|3
2|3
3|3
4|3
4|4
1000000|1

cat analysis20090508data
#!/bin/awk -f
#Fri May 8 18:32:59 CST 2009

BEGIN {
FS="|"
}

{
array1[$1]+=$2
}
END {
# n=asort(array1,dest)
print n"\n"
for(i in array1)
{
print i":"array1[i]
}
#print array1[1]
}

使用:
awk -f analysis20090508data 20090508data|sort -t: -k1n

结果:

1:5
2:3
3:3
4:7
1000000:1


2009/5/8 ☼ 林永忠 ☼ (Yung-chung Lin) <henearkrxern@gmail.com>:
> 可以這樣寫
>
> use Data::Dumper;
>
> my %hash;
>
> while (my $line = <STDIN>) {
>     my ($a, $b) = split /\|/, $line;
>     $hash{$a} += $b;
> }
>
> print Dumper \%hash;
>
>
> 請參考
>
> Best,
> Yung-chung Lin
>
> 2009/5/8 Gene <netgene@hotmail.com>
>>
>> 怎样做效率高?
>> 若域1相同的则进行合并,如下1|2和1|3合并成1|5:
>> 1|2
>> 1|3
>> 2|3
>> 3|3
>> 4|3
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

求问是哪个商业公司?

2009/5/8 Mr Liu <submox@gmail.com>:
> A+C
>
> 2009/5/8 小木头 <e4twood@gmail.com>
>>
>> ABC都有吧
>> 2009/5/8 <123456fuzhong@sohu.com>:
>> > 我选择C
>> >
>> >
>> >
>> >
>> >
>> > ----- 原文 -----
>> > From: Beckheng Lam<bi.ken.lam@gmail.com>
>> > Subject:[PerlChina] 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?
>> >
>> > A.有商业公司的强大支持
>> > B.有开源社区的强大支持
>> > C.有相关开源/商业产品的大量使用
>> > D.在中国有大量FANS
>> > E.时机未到
>> > 抽奖换礼 好运有你!
>> > 我所见过的劳动节最美的礼物!
>> > >
>> >
>>
>>
>
>
>
> --
> 温和地坚持,并且微笑
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

A+C

2009/5/8 小木头 <e4twood@gmail.com>
ABC都有吧
2009/5/8  <123456fuzhong@sohu.com>:
> 我选择C
>
>
>
>
>
> ----- 原文 -----
> From: Beckheng Lam<bi.ken.lam@gmail.com>
> Subject:[PerlChina] 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?
>
> A.有商业公司的强大支持
> B.有开源社区的强大支持
> C.有相关开源/商业产品的大量使用
> D.在中国有大量FANS
> E.时机未到
> 抽奖换礼 好运有你!
> 我所见过的劳动节最美的礼物!
> >
>





--
温和地坚持,并且微笑

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: perl response

你的client期待什么样的数据你就返回什么样的数据呗。
直接的文本, json, xml, html片断都行。
这与服务器端用不用perl没关系,用什么往出输出都一样的。


2009/5/8 Fayland Lam <fayland@gmail.com>
normal pl you can just print "somthing";
catalyst you can do $c->res->body("another");

2009/5/8 yi wang <wangyi2412@gmail.com>:
> 在学习Ajax,服务器端用perl。(不想用Perl::Ajax 模块)
> 请问个应该不算难的问题,但不好google到,请教各位:
>
> 服务器端如何写代码返回给客户端的XMLHttpRequest().responseText, 即,在服务器端的perl代码应该如何return
> 处理结果。
>
> 期待中,谢谢!
>
>
> Best Wishes,
>
>
> >
>



--
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/





--

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: perl response

normal pl you can just print "somthing";
catalyst you can do $c->res->body("another");

2009/5/8 yi wang <wangyi2412@gmail.com>:
> 在学习Ajax,服务器端用perl。(不想用Perl::Ajax 模块)
> 请问个应该不算难的问题,但不好google到,请教各位:
>
> 服务器端如何写代码返回给客户端的XMLHttpRequest().responseText, 即,在服务器端的perl代码应该如何return
> 处理结果。
>
> 期待中,谢谢!
>
>
> Best Wishes,
>
>
> >
>

--
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] perl response

在学习Ajax,服务器端用perl。(不想用Perl::Ajax 模块)
请问个应该不算难的问题,但不好google到,请教各位:
 
服务器端如何写代码返回给客户端的XMLHttpRequest().responseText, 即,在服务器端的perl代码应该如何return 处理结果。

期待中,谢谢!


Best Wishes,


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

可以這樣寫

use Data::Dumper;

my %hash;

while (my $line = <STDIN>) {
    my ($a, $b) = split /\|/, $line;
    $hash{$a} += $b;
}

print Dumper \%hash;


請參考

Best,
Yung-chung Lin

2009/5/8 Gene <netgene@hotmail.com>
怎样做效率高?
若域1相同的则进行合并,如下1|2和1|3合并成1|5:
1|2
1|3
2|3
3|3
4|3



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 关于获取运行时的命令行参数的问题

I see.

----- Original Message -----
From: agentzh
To: perlchina@googlegroups.com
Sent: Friday, May 08, 2009 3:05 PM
Subject: [PerlChina] Re: 关于获取运行时的命令行参数的问题


2009/5/8 Jester <jester@perlchina.org>

如果用下面的方法运行一个perl脚本:
myprogram.pl input1 input2 > output.txt

对于你的 perl 脚本而言,输出文件句柄就是 stdout ;) 它好像没有一般意义上的"文件名"的说,呵呵。。。如果真需要名字,我们一般这么写:

myprogram.pl -o output.txt input1 input2...


-agentzh


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 请教合并一文件中域1相同的记录,域2进行累加

hash

----- Original Message -----
From: "Gene" <netgene@hotmail.com>
To: "PerlChina Mongers 讨论组" <perlchina@googlegroups.com>
Sent: Friday, May 08, 2009 2:51 PM
Subject: [PerlChina] 请教合并一文件中域1相同的记录,域2进行累加


> 怎样做效率高?
> 若域1相同的则进行合并,如下1|2和1|3合并成1|5:
> 1|2
> 1|3
> 2|3
> 3|3
> 4|3
> >
>
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 关于获取运行时的命令行参数的问题

2009/5/8 Jester <jester@perlchina.org>
如果用下面的方法运行一个perl脚本:
myprogram.pl input1 input2 > output.txt

对于你的 perl 脚本而言,输出文件句柄就是 stdout ;) 它好像没有一般意义上的"文件名"的说,呵呵。。。如果真需要名字,我们一般这么写:

myprogram.pl -o output.txt input1 input2...

-agentzh

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

2009年5月7日星期四

[PerlChina] 请教合并一文件中域1相同的记录,域2进行累加

怎样做效率高?
若域1相同的则进行合并,如下1|2和1|3合并成1|5:
1|2
1|3
2|3
3|3
4|3
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 关于获取运行时的命令行参数的问题

2009/5/8 Jester <jester@perlchina.org>:
> 如果用下面的方法运行一个perl脚本:
> myprogram.pl input1 input2 > output.txt
> 在myprogram.pl里,我知道用@ARGV可以获取input1和input2的值,但是如何获取output.txt的值呢?
> 也就是将标准输出重定向后的文件名,我在程序里面能知道运行时是重定向到了哪个文件吗?

重定向这个是 Shell 做的,要在 Perl 中知道这个名字,就需要能从 file handle 获取它对应的文件。
但是,在 Perl 中能获取这个么?好像默认是不行的。

lee

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 关于获取运行时的命令行参数的问题

为什么不把output.txt当作参数传进去?

-----Original Message-----
From: perlchina@googlegroups.com [mailto:perlchina@googlegroups.com] On Behalf Of Jester
Sent: Friday, May 08, 2009 1:21 PM
To: perlchina@googlegroups.com
Subject: [PerlChina] 关于获取运行时的命令行参数的问题

如果用下面的方法运行一个perl脚本:
myprogram.pl input1 input2 > output.txt
在myprogram.pl里,我知道用@ARGV可以获取input1和input2的值,但是如何获取output.txt的值呢?
也就是将标准输出重定向后的文件名,我在程序里面能知道运行时是重定向到了哪个文件吗?


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] 关于获取运行时的命令行参数的问题

如果用下面的方法运行一个perl脚本:
myprogram.pl input1 input2 > output.txt
在myprogram.pl里,我知道用@ARGV可以获取input1和input2的值,但是如何获取output.txt的值呢?
也就是将标准输出重定向后的文件名,我在程序里面能知道运行时是重定向到了哪个文件吗?
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

ABC都有吧
2009/5/8 <123456fuzhong@sohu.com>:
> 我选择C
>
>
>
>
>
> ----- 原文 -----
> From: Beckheng Lam<bi.ken.lam@gmail.com>
> Subject:[PerlChina] 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?
>
> A.有商业公司的强大支持
> B.有开源社区的强大支持
> C.有相关开源/商业产品的大量使用
> D.在中国有大量FANS
> E.时机未到
> 抽奖换礼 好运有你!
> 我所见过的劳动节最美的礼物!
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

回复: [PerlChina] 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

我选择C





----- 原文 -----

From: Beckheng Lam<bi.ken.lam@gmail.com>
Subject:[PerlChina] 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

A.有商业公司的强大支持
B.有开源社区的强大支持
C.有相关开源/商业产品的大量使用
D.在中国有大量FANS
E.时机未到

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

ABCD <----- ^_^

2009/5/8 Michael Zeng <galaxy2004@gmail.com>
d 吧

On 5/8/09, raul(smallfish) <annyraul@gmail.com> wrote:
A + C
--
╭⌒ ⌒╮
╭ · · ╮   - hello :)
╰━━0━━╯
< ---------------------------------------------------
blog : http://annyraul.blogspot.com
old   : http://hi.baidu.com/smallfish7788
--------------------------------------------------- >


2009/5/7 Beckheng Lam <bi.ken.lam@gmail.com>
A.有商业公司的强大支持

B.有开源社区的强大支持
C.有相关开源/商业产品的大量使用
D.在中国有大量FANS
E.时机未到







--
            Yours Sincerely
                    Zeng Hong



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

d 吧

On 5/8/09, raul(smallfish) <annyraul@gmail.com> wrote:
A + C
--
╭⌒ ⌒╮
╭ · · ╮   - hello :)
╰━━0━━╯
< ---------------------------------------------------
blog : http://annyraul.blogspot.com
old   : http://hi.baidu.com/smallfish7788
--------------------------------------------------- >


2009/5/7 Beckheng Lam <bi.ken.lam@gmail.com>
A.有商业公司的强大支持

B.有开源社区的强大支持
C.有相关开源/商业产品的大量使用
D.在中国有大量FANS
E.时机未到







--
            Yours Sincerely
                    Zeng Hong
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?

用-I参数,可以维护一个自己的模块仓库。

________________________________________
From: xsir317 [mailto:xsir317@163.com]
Sent: Thursday, May 07, 2009 7:33 PM
To: perlchina
Subject: [PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?

我们公司(www.sundns.com)的主机似乎是支持的。我刚进公司不久,这块还没时间去了解,有需要的话可以电话客服去问问。
 
 
2009-05-07
________________________________________
xsir317
________________________________________
发件人: Beckheng Lam
发送时间: 2009-05-07  18:09:14
收件人: perlchina
抄送:
主题: [PerlChina] 现在国内支持客户自己安装PERL模块的主机空间有哪些?
我在用webhostingpad.com的,功能已经足够强大。
有个客户的网站,我也想将其放在上面,但担心客户受一些因素(例如光缆断开 :-) )影响以后会提出改空间,想提前了解一下,国内有没有可以做到类似的。
因为webhostingpad.com的cpanel是可以支持自己安装相应的Perl模块的。

--
Perl乐事 -- http://www.perlersh.org
我的博客 -- http://www.perlersh.org/blog.html
<BR

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

A + C
--
╭⌒ ⌒╮
╭ · · ╮   - hello :)
╰━━0━━╯
< ---------------------------------------------------
blog : http://annyraul.blogspot.com
old   : http://hi.baidu.com/smallfish7788
--------------------------------------------------- >


2009/5/7 Beckheng Lam <bi.ken.lam@gmail.com>
A.有商业公司的强大支持
B.有开源社区的强大支持
C.有相关开源/商业产品的大量使用
D.在中国有大量FANS
E.时机未到



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

我看是B和C

2009/5/7 Beckheng Lam <bi.ken.lam@gmail.com>:
> A.有商业公司的强大支持
> B.有开源社区的强大支持
> C.有相关开源/商业产品的大量使用
> D.在中国有大量FANS
> E.时机未到
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] 开心投票: Perl可以三十年不倒,你认为是下面哪个答案?

A.有商业公司的强大支持
B.有开源社区的强大支持
C.有相关开源/商业产品的大量使用
D.在中国有大量FANS
E.时机未到
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?

国内好像很少吧,有这种需求可以考虑买VPS

2009/5/7 xsir317 <xsir317@163.com>:
> 嗯。。。机房被攻击很正常吧。。。反正那块不是我管的。。。我一个写代码的而已。。。
>
>
> 2009-05-07
> ________________________________
> xsir317
> ________________________________
> 发件人: Jacky Wu
> 发送时间: 2009-05-07 19:39:19
> 收件人: perlchina
> 抄送:
> 主题: [PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?
> 有孚前段时间是不是服务器被攻击啊,有一次你们主页都不能显示。
>
>
>
> 2009/5/7 xsir317 <xsir317@163.com>
>>
>> 我们公司(www.sundns.com)的主机似乎是支持的。我刚进公司不久,这块还没时间去了解,有需要的话可以电话客服去问问。
>>
>>
>> 2009-05-07
>> ________________________________
>> xsir317
>> ________________________________
>> 发件人: Beckheng Lam
>> 发送时间: 2009-05-07 18:09:14
>> 收件人: perlchina
>> 抄送:
>> 主题: [PerlChina] 现在国内支持客户自己安装PERL模块的主机空间有哪些?
>> 我在用webhostingpad.com的,功能已经足够强大。
>> 有个客户的网站,我也想将其放在上面,但担心客户受一些因素(例如光缆断开 :-) )影响以后会提出改空间,想提前了解一下,国内有没有可以做到类似的。
>> 因为webhostingpad.com的cpanel是可以支持自己安装相应的Perl模块的。
>>
>> --
>> Perl乐事 -- http://www.perlersh.org
>> 我的博客 -- http://www.perlersh.org/blog.html
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?

嗯。。。机房被攻击很正常吧。。。反正那块不是我管的。。。我一个写代码的而已。。。
 
 
2009-05-07

xsir317

发件人: Jacky Wu
发送时间: 2009-05-07  19:39:19
收件人: perlchina
抄送:
主题: [PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?
有孚前段时间是不是服务器被攻击啊,有一次你们主页都不能显示。



2009/5/7 xsir317 <xsir317@163.com>
我们公司(www.sundns.com)的主机似乎是支持的。我刚进公司不久,这块还没时间去了解,有需要的话可以电话客服去问问。
 
 
2009-05-07

xsir317

发件人: Beckheng Lam
发送时间: 2009-05-07  18:09:14
收件人: perlchina
抄送:
主题: [PerlChina] 现在国内支持客户自己安装PERL模块的主机空间有哪些?
我在用webhostingpad.com的,功能已经足够强大。
有个客户的网站,我也想将其放在上面,但担心客户受一些因素(例如光缆断开 :-) )影响以后会提出改空间,想提前了解一下,国内有没有可以做到类似的。
因为webhostingpad.com的cpanel是可以支持自己安装相应的Perl模块的。

--   Perl乐事 -- http://www.perlersh.org  我的博客 -- http://www.perlersh.org/blog.html  


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?

有孚前段时间是不是服务器被攻击啊,有一次你们主页都不能显示。



2009/5/7 xsir317 <xsir317@163.com>
我们公司(www.sundns.com)的主机似乎是支持的。我刚进公司不久,这块还没时间去了解,有需要的话可以电话客服去问问。
 
 
2009-05-07

xsir317

发件人: Beckheng Lam
发送时间: 2009-05-07  18:09:14
收件人: perlchina
抄送:
主题: [PerlChina] 现在国内支持客户自己安装PERL模块的主机空间有哪些?
我在用webhostingpad.com的,功能已经足够强大。
有个客户的网站,我也想将其放在上面,但担心客户受一些因素(例如光缆断开 :-) )影响以后会提出改空间,想提前了解一下,国内有没有可以做到类似的。
因为webhostingpad.com的cpanel是可以支持自己安装相应的Perl模块的。

--  Perl乐事 -- http://www.perlersh.org 我的博客 -- http://www.perlersh.org/blog.html 



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 现在国内支持客户自己安装PERL模块的主机空间有哪些?

我们公司(www.sundns.com)的主机似乎是支持的。我刚进公司不久,这块还没时间去了解,有需要的话可以电话客服去问问。
 
 
2009-05-07

xsir317

发件人: Beckheng Lam
发送时间: 2009-05-07  18:09:14
收件人: perlchina
抄送:
主题: [PerlChina] 现在国内支持客户自己安装PERL模块的主机空间有哪些?
我在用webhostingpad.com的,功能已经足够强大。
有个客户的网站,我也想将其放在上面,但担心客户受一些因素(例如光缆断开 :-) )影响以后会提出改空间,想提前了解一下,国内有没有可以做到类似的。
因为webhostingpad.com的cpanel是可以支持自己安装相应的Perl模块的。

--   Perl乐事 -- http://www.perlersh.org  我的博客 -- http://www.perlersh.org/blog.html  
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] 现在国内支持客户自己安装PERL模块的主机空间有哪些?

我在用webhostingpad.com的,功能已经足够强大。
有个客户的网站,我也想将其放在上面,但担心客户受一些因素(例如光缆断开 :-) )影响以后会提出改空间,想提前了解一下,国内有没有可以做到类似的。
因为webhostingpad.com的cpanel是可以支持自己安装相应的Perl模块的。

--  Perl乐事 -- http://www.perlersh.org 我的博客 -- http://www.perlersh.org/blog.html 

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

2009年5月6日星期三

[PerlChina] Re: metacharacters 的屏蔽

这个好像是这样的,不过,我处理的东西好像不会遇见这种情况。

On 5月5日, 上午11时43分, Michael Zeng <galaxy2...@gmail.com> wrote:
> 是啊, \Q \E 就是 等于 quotemeta
>
> 不过 要是 里面 含有 \E 的话, 就不太一样
>
> On 5/5/09, mark <zhusheng...@163.com> wrote:
>
>
>
>
>
>
>
> > 我去查资料,发现有两种方式:(1)就是quotemeta函数:Returns the value of EXPR with all
> > non-"word" characters backslashed. (That is, all characters not
> > matching /[A-Za-z_0-9]/ will be preceded by a backslash in the
> > returned string, regardless of any locale settings.) This is the
> > internal function implementing the \Q escape in double-quoted strings
> > (2) 就是,$query='c:\zhu\perl\'
> > m/\Q$query\E/。
>
> > On 5月5日, 上午9时27分, agentzh <agen...@gmail.com> wrote:
> > > 2009/5/4 mark <zhusheng...@163.com>
>
> > > > 有没有人知道,屏蔽元字符(即将元字符当作普通字符处理)。
>
> > > quotemeta?
>
> > > -agentzh
>
> --
> Yours Sincerely
> Zeng Hong- 隐藏被引用文字 -
>
> - 显示引用的文字 -
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

2009年5月4日星期一

[PerlChina] Re: metacharacters 的屏蔽

是啊,  \Q \E 就是 等于 quotemeta 

不过 要是 里面 含有  \E 的话, 就不太一样






On 5/5/09, mark <zhusheng303@163.com> wrote:
我去查资料,发现有两种方式:(1)就是quotemeta函数:Returns the value of EXPR with all
non-"word" characters backslashed. (That is, all characters not
matching /[A-Za-z_0-9]/ will be preceded by a backslash in the
returned string, regardless of any locale settings.) This is the
internal function implementing the \Q escape in double-quoted strings
(2) 就是,$query='c:\zhu\perl\'
      m/\Q$query\E/。

On 5月5日, 上午9时27分, agentzh <agen...@gmail.com> wrote:
> 2009/5/4 mark <zhusheng...@163.com>

>
> > 有没有人知道,屏蔽元字符(即将元字符当作普通字符处理)。
>
> quotemeta?
>
> -agentzh


--
            Yours Sincerely
                    Zeng Hong
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: metacharacters 的屏蔽

我去查资料,发现有两种方式:(1)就是quotemeta函数:Returns the value of EXPR with all
non-"word" characters backslashed. (That is, all characters not
matching /[A-Za-z_0-9]/ will be preceded by a backslash in the
returned string, regardless of any locale settings.) This is the
internal function implementing the \Q escape in double-quoted strings
(2) 就是,$query='c:\zhu\perl\'
m/\Q$query\E/。

On 5月5日, 上午9时27分, agentzh <agen...@gmail.com> wrote:
> 2009/5/4 mark <zhusheng...@163.com>
>
> > 有没有人知道,屏蔽元字符(即将元字符当作普通字符处理)。
>
> quotemeta?
>
> -agentzh
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: metacharacters 的屏蔽

你说在regex里面?用  \ 即可,或者放到 [] 里面, 不过 [] 里面有时候也需要 \ 的



On 5/5/09, agentzh <agentzh@gmail.com> wrote:
2009/5/4 mark <zhusheng303@163.com>
有没有人知道,屏蔽元字符(即将元字符当作普通字符处理)。

quotemeta?

-agentzh






--
            Yours Sincerely
                    Zeng Hong
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: metacharacters 的屏蔽

2009/5/4 mark <zhusheng303@163.com>
有没有人知道,屏蔽元字符(即将元字符当作普通字符处理)。

quotemeta?

-agentzh

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: metacharacters 的屏蔽

可以用引号或者转义字符吧

2009/5/4 mark <zhusheng303@163.com>
有没有人知道,屏蔽元字符(即将元字符当作普通字符处理)。



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] metacharacters 的屏蔽

有没有人知道,屏蔽元字符(即将元字符当作普通字符处理)。
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 【求助】安装Bioperl的一个问题

你是不是忘了加Bioperl的软件源了,具体可以参考以下网页:
http://www.bioperl.org/wiki/Installing_Bioperl_on_Windows

就是在PPM的源中加下面的东西:
Repositories to add Name      perl 5.8              perl 5.10
BioPerl-Regular Releases   http://bioperl.org/DIST
http://bioperl.org/DIST
BioPerl-Release
Candidates  http://bioperl.org/DIST/RC
http://bioperl.org/DIST/RC
Kobes http://theoryx5.uwinnipeg.ca/ppms
http://cpan.uwinnipeg.ca/PPMPackages/10xx/
Bribes http://www.Bribes.org/perl/ppm
http://www.Bribes.org/perl/ppm
tcool http://ppm.tcool.org/archives/
NA

最的一个"tcool"在5.10版本里没有,不过不影响使用的,安装过程很慢,呵呵,耐心些吧。

On 5月4日, 上午10时13分, Guifeng Wei <guifeng...@gmail.com> wrote:
> 最近,因为电脑重新安装了系统,perl又安装了一遍,再bioperl的时候,老是出问题。
> ppm install failed:Can't find any package that provide DB_File::for
> Bundle-Bioperl-Core
>
> 求助高手帮助给解决一下问题。深表感谢。
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

2009年5月3日星期日

Re: 回复: [PerlChina] 【求助】安装Bioperl的一个问题

很久没有用windows上的bioperl了。不过应该是repository的问题,把一下几个在ppm里面加上再装就好了:


更详细信息可以看这个页面:


Jie Zhou
Department of Human Genetics,
Institute of Genomics and Systems Biology,
University of Chicago
920 East 58th Street, CLSC 431
Chicago, IL 60637



2009/5/3 Guifeng Wei <guifengwei@gmail.com>
Windows XP

On 5月4日, 上午11时12分, greatsun lea <greatsun...@yahoo.com.cn> wrote:
> 系统是XP or Linux??
>
> --- 09年5月4日,周一, Guifeng Wei <guifeng...@gmail.com> 写道:
>
> 发件人: Guifeng Wei <guifeng...@gmail.com>
> 主题: [PerlChina] 【求助】安装Bioperl的一个问题
> 收件人: "PerlChina Mongers 讨论组" <perlchina@googlegroups.com>
> 日期: 2009年5月4日,周一,上午10:13
>
> 最近,因为电脑重新安装了系统,perl又安装了一遍,再bioperl的时候,老是出问题。
> ppm install failed:Can't find any package that provide DB_File::for
> Bundle-Bioperl-Core
>
> 求助高手帮助给解决一下问题。深表感谢。
>
>       ___________________________________________________________
>   好玩贺卡等你发,邮箱贺卡全新上线!http://card.mail.cn.yahoo.com/



--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

Re: 回复: [PerlChina] 【求助】安装Bioperl的一个问题

Windows XP

On 5月4日, 上午11时12分, greatsun lea <greatsun...@yahoo.com.cn> wrote:
> 系统是XP or Linux??
>
> --- 09年5月4日,周一, Guifeng Wei <guifeng...@gmail.com> 写道:
>
> 发件人: Guifeng Wei <guifeng...@gmail.com>
> 主题: [PerlChina] 【求助】安装Bioperl的一个问题
> 收件人: "PerlChina Mongers 讨论组" <perlchina@googlegroups.com>
> 日期: 2009年5月4日,周一,上午10:13
>
> 最近,因为电脑重新安装了系统,perl又安装了一遍,再bioperl的时候,老是出问题。
> ppm install failed:Can't find any package that provide DB_File::for
> Bundle-Bioperl-Core
>
> 求助高手帮助给解决一下问题。深表感谢。
>
> ___________________________________________________________
> 好玩贺卡等你发,邮箱贺卡全新上线!http://card.mail.cn.yahoo.com/
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

回复: [PerlChina] 【求助】安装Bioperl的一个问题

抽奖换礼 好运有你!
我所见过的劳动节最美的礼物!
系统是XP or Linux??

--- 09年5月4日,周一, Guifeng Wei <guifengwei@gmail.com> 写道:

发件人: Guifeng Wei <guifengwei@gmail.com>
主题: [PerlChina] 【求助】安装Bioperl的一个问题
收件人: "PerlChina Mongers 讨论组" <perlchina@googlegroups.com>
日期: 2009年5月4日,周一,上午10:13

[PerlChina] 【求助】安装Bioperl的一个问题

最近,因为电脑重新安装了系统,perl又安装了一遍,再bioperl的时候,老是出问题。
ppm install failed:Can't find any package that provide DB_File::for
Bundle-Bioperl-Core

求助高手帮助给解决一下问题。深表感谢。
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 我们协会的网站。。。很妖异的问题。。。

可能是服务器中毒。

2009/5/3 xsir317 <xsir317@163.com>
 
我在CSDN问过了。。。欢迎大家去拿分。
 
我的网站
www.shwzq.com
 


现在打开主页突然非常慢。用FF看的时候显示一直在等待3gxz.com,我就打开adblock plus,看到有个http://3gxz.com/news/templets/plus/templet.css 文件,屏蔽掉,速度恢复正常。

为什么我的网站会引用http://3gxz.com/news/templets/plus/templet.css 文件呢?我看了模板似乎没有啊。。


谁能告诉我,在主页的HTML中,到底是哪里引用了 http://3gxz.com/news/templets/plus/templet.css 这个文件?
 
2009-05-03

xsir317





--
Regards.

-HackerGene.

--~--~---------~--~----~------------~-------~--~----~
HomePage: http://www.hackergene.com
Projects:     http://snort.org.cn
                 http://netbsd.org.cn
--~--~---------~--~----~------------~-------~--~----~

We advocate the philosophy which lead us to explore the world that is "Free , Opensource and Share".
                                                                     ---Allhonker Network Information Security Team.

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 我们协会的网站。。。很妖异的问题。。。

= = 已经解决。。。谢谢。。。
 
 
2009-05-04

xsir317

发件人: xsir317
发送时间: 2009-05-03  23:00:30
收件人: perlchina
抄送:
主题: [PerlChina] 我们协会的网站。。。很妖异的问题。。。
 
我在CSDN问过了。。。欢迎大家去拿分。
 
我的网站
www.shwzq.com
 


现在打开主页突然非常慢。用FF看的时候显示一直在等待3gxz.com,我就打开adblock plus,看到有个http://3gxz.com/news/templets/plus/templet.css 文件,屏蔽掉,速度恢复正常。

为什么我的网站会引用http://3gxz.com/news/templets/plus/templet.css 文件呢?我看了模板似乎没有啊。。


谁能告诉我,在主页的HTML中,到底是哪里引用了 http://3gxz.com/news/templets/plus/templet.css 这个文件?
 
2009-05-03

xsir317
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] 我们协会的网站。。。很妖异的问题。。。

 
我在CSDN问过了。。。欢迎大家去拿分。
 
我的网站
www.shwzq.com
 


现在打开主页突然非常慢。用FF看的时候显示一直在等待3gxz.com,我就打开adblock plus,看到有个http://3gxz.com/news/templets/plus/templet.css 文件,屏蔽掉,速度恢复正常。

为什么我的网站会引用http://3gxz.com/news/templets/plus/templet.css 文件呢?我看了模板似乎没有啊。。


谁能告诉我,在主页的HTML中,到底是哪里引用了 http://3gxz.com/news/templets/plus/templet.css 这个文件?
 
2009-05-03

xsir317

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: 编写提取染色体CDS的问题

呵呵,好久不见~

On 5月3日, 上午10时47分, Jie Zhou <jzhou...@gmail.com> wrote:
> 只要CDS的话,直接去UCSC下载就好了,这里要什么有什么。
>
> http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/
>
> bioperl够你研究半个月了, 如果不是非常需要设计复杂的序列分析程序的话,还是直接下现成的好。
>
> Jie Zhou
> Department of Human Genetics,
> Institute of Genomics and Systems Biology,
> University of Chicago
> 920 East 58th Street, CLSC 431
> Chicago, IL 60637
>

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---