2012年8月7日星期二

Re: [PerlChina] 一个坑,自己掉进去好几次了。。。



A Small Aside… In Perl 6 the variables $a and $b don’t have any special global significance like they do in Perl 5. Use normal named variables ($var), positional variables ($^var) or whatever variables (*) in the sort comparison block just like any other code block.




2012/8/7 Robin Lee <robinlee.sysu@gmail.com>
不过,my $a 之后,一旦在它的lexical scope 里用 sort 就悲剧了。这样说来, my $a 的确是个坑


2012/8/7 Robin Lee <robinlee.sysu@gmail.com>
$a $b 只在 sort 里是预设变量。在其它地方没有特别


2012/8/7 Anthony WU <anthonywuy2k@gmail.com>
不是����
而是 $a�$b都是���量………
-------- Original Message --------
Subject: Re: [PerlChina] 一个坑,自己掉进去好几次了。。。
From: wd <wd@wdicc.com>
To: perlchina@googlegroups.com
Date: 7/8/2012 10:55
> if (not defined $a || $a == 0  )
> 优先级问题,本意是 ( (not defined $a) || $a == 0  ),实际是 (not ( defined $a || $a == 0 ) )
>
> perl 里面 ! 和 not,and 和 && 优先级不一样。
>
> 2012/8/6  <mwjpiero@gmail.com>:
>> 新手求教什麽坑?
>>
>>
>>
>> -- Sent from my HP TouchPad
>> ________________________________
>> On 6 Aug 2012 21:09, Huangj <redspid@163.com> wrote:
>> 俺都介么写
>>
>> my $y;
>> unless ( $y ) { print 1; }
>>
>>
>>
>> 在 2012-06-29 13:19:39,"joe jiang" <lamp.purl@gmail.com> 写道:
>>
>>   DB<7> print 1 if !defined $a or $a == 0;
>> 1
>>
>>
>> 2012/6/29 cnhack TNT <cnhacktnt@gmail.com>
>>> 同掉过,路过。。。
>>>
>>>
>>>
>>> 2012/6/29 wd <wd@wdicc.com>
>>>> #!/usr/bin/perl
>>>>
>>>> use strict;
>>>> use warnings;
>>>>
>>>> my $a;
>>>>
>>>> if ( not defined $a || $a == 0 ) {
>>>>    print 1;
>>>> }
>>>>
>>>> 就这段代码。。明眼人应该能看明白错在哪里。。。我已经掉进去好几次了。。。好像还在持续的掉。。nnd。。。
>>>>
>>>> --
>>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>>>
>>> --
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>>
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。



--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。



--
Hao Wu

Lab: 334-844-2494 
Mail: 301 Funchess Hall, 
        Auburn University, 
        AL, 36849, USA

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: [PerlChina] 一个坑,自己掉进去好几次了。。。

不过,my $a 之后,一旦在它的lexical scope 里用 sort 就悲剧了。这样说来, my $a 的确是个坑

2012/8/7 Robin Lee <robinlee.sysu@gmail.com>
$a $b 只在 sort 里是预设变量。在其它地方没有特别


2012/8/7 Anthony WU <anthonywuy2k@gmail.com>
不是����
而是 $a�$b都是���量………
-------- Original Message --------
Subject: Re: [PerlChina] 一个坑,自己掉进去好几次了。。。
From: wd <wd@wdicc.com>
To: perlchina@googlegroups.com
Date: 7/8/2012 10:55
> if (not defined $a || $a == 0  )
> 优先级问题,本意是 ( (not defined $a) || $a == 0  ),实际是 (not ( defined $a || $a == 0 ) )
>
> perl 里面 ! 和 not,and 和 && 优先级不一样。
>
> 2012/8/6  <mwjpiero@gmail.com>:
>> 新手求教什麽坑?
>>
>>
>>
>> -- Sent from my HP TouchPad
>> ________________________________
>> On 6 Aug 2012 21:09, Huangj <redspid@163.com> wrote:
>> 俺都介么写
>>
>> my $y;
>> unless ( $y ) { print 1; }
>>
>>
>>
>> 在 2012-06-29 13:19:39,"joe jiang" <lamp.purl@gmail.com> 写道:
>>
>>   DB<7> print 1 if !defined $a or $a == 0;
>> 1
>>
>>
>> 2012/6/29 cnhack TNT <cnhacktnt@gmail.com>
>>> 同掉过,路过。。。
>>>
>>>
>>>
>>> 2012/6/29 wd <wd@wdicc.com>
>>>> #!/usr/bin/perl
>>>>
>>>> use strict;
>>>> use warnings;
>>>>
>>>> my $a;
>>>>
>>>> if ( not defined $a || $a == 0 ) {
>>>>    print 1;
>>>> }
>>>>
>>>> 就这段代码。。明眼人应该能看明白错在哪里。。。我已经掉进去好几次了。。。好像还在持续的掉。。nnd。。。
>>>>
>>>> --
>>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>>>
>>> --
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>>
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。



--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: [PerlChina] 一个坑,自己掉进去好几次了。。。

$a $b 只在 sort 里是预设变量。在其它地方没有特别

2012/8/7 Anthony WU <anthonywuy2k@gmail.com>
不是����
而是 $a�$b都是���量………
-------- Original Message --------
Subject: Re: [PerlChina] 一个坑,自己掉进去好几次了。。。
From: wd <wd@wdicc.com>
To: perlchina@googlegroups.com
Date: 7/8/2012 10:55
> if (not defined $a || $a == 0  )
> 优先级问题,本意是 ( (not defined $a) || $a == 0  ),实际是 (not ( defined $a || $a == 0 ) )
>
> perl 里面 ! 和 not,and 和 && 优先级不一样。
>
> 2012/8/6  <mwjpiero@gmail.com>:
>> 新手求教什麽坑?
>>
>>
>>
>> -- Sent from my HP TouchPad
>> ________________________________
>> On 6 Aug 2012 21:09, Huangj <redspid@163.com> wrote:
>> 俺都介么写
>>
>> my $y;
>> unless ( $y ) { print 1; }
>>
>>
>>
>> 在 2012-06-29 13:19:39,"joe jiang" <lamp.purl@gmail.com> 写道:
>>
>>   DB<7> print 1 if !defined $a or $a == 0;
>> 1
>>
>>
>> 2012/6/29 cnhack TNT <cnhacktnt@gmail.com>
>>> 同掉过,路过。。。
>>>
>>>
>>>
>>> 2012/6/29 wd <wd@wdicc.com>
>>>> #!/usr/bin/perl
>>>>
>>>> use strict;
>>>> use warnings;
>>>>
>>>> my $a;
>>>>
>>>> if ( not defined $a || $a == 0 ) {
>>>>    print 1;
>>>> }
>>>>
>>>> 就这段代码。。明眼人应该能看明白错在哪里。。。我已经掉进去好几次了。。。好像还在持续的掉。。nnd。。。
>>>>
>>>> --
>>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>>>
>>> --
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>>
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: [PerlChina] 一个坑,自己掉进去好几次了。。。

不是����
而是 $a�$b都是���量………
-------- Original Message --------
Subject: Re: [PerlChina] 一个坑,自己掉进去好几次了。。。
From: wd <wd@wdicc.com>
To: perlchina@googlegroups.com
Date: 7/8/2012 10:55
> if (not defined $a || $a == 0 )
> 优先级问题,本意是 ( (not defined $a) || $a == 0 ),实际是 (not ( defined $a || $a == 0 ) )
>
> perl 里面 ! 和 not,and 和 && 优先级不一样。
>
> 2012/8/6 <mwjpiero@gmail.com>:
>> 新手求教什麽坑?
>>
>>
>>
>> -- Sent from my HP TouchPad
>> ________________________________
>> On 6 Aug 2012 21:09, Huangj <redspid@163.com> wrote:
>> 俺都介么写
>>
>> my $y;
>> unless ( $y ) { print 1; }
>>
>>
>>
>> 在 2012-06-29 13:19:39,"joe jiang" <lamp.purl@gmail.com> 写道:
>>
>> DB<7> print 1 if !defined $a or $a == 0;
>> 1
>>
>>
>> 2012/6/29 cnhack TNT <cnhacktnt@gmail.com>
>>> 同掉过,路过。。。
>>>
>>>
>>>
>>> 2012/6/29 wd <wd@wdicc.com>
>>>> #!/usr/bin/perl
>>>>
>>>> use strict;
>>>> use warnings;
>>>>
>>>> my $a;
>>>>
>>>> if ( not defined $a || $a == 0 ) {
>>>> print 1;
>>>> }
>>>>
>>>> 就这段代码。。明眼人应该能看明白错在哪里。。。我已经掉进去好几次了。。。好像还在持续的掉。。nnd。。。
>>>>
>>>> --
>>>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>>>
>>> --
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>>
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

2012年8月6日星期一

Re: Re:Re: [PerlChina] 一个坑,自己掉进去好几次了。。。

if (not defined $a || $a == 0 )
优先级问题,本意是 ( (not defined $a) || $a == 0 ),实际是 (not ( defined $a || $a == 0 ) )

perl 里面 ! 和 not,and 和 && 优先级不一样。

2012/8/6 <mwjpiero@gmail.com>:
> 新手求教什麽坑?
>
>
>
> -- Sent from my HP TouchPad
> ________________________________
> On 6 Aug 2012 21:09, Huangj <redspid@163.com> wrote:
> 俺都介么写
>
> my $y;
> unless ( $y ) { print 1; }
>
>
>
> 在 2012-06-29 13:19:39,"joe jiang" <lamp.purl@gmail.com> 写道:
>
> DB<7> print 1 if !defined $a or $a == 0;
> 1
>
>
> 2012/6/29 cnhack TNT <cnhacktnt@gmail.com>
>>
>> 同掉过,路过。。。
>>
>>
>>
>> 2012/6/29 wd <wd@wdicc.com>
>>>
>>> #!/usr/bin/perl
>>>
>>> use strict;
>>> use warnings;
>>>
>>> my $a;
>>>
>>> if ( not defined $a || $a == 0 ) {
>>> print 1;
>>> }
>>>
>>> 就这段代码。。明眼人应该能看明白错在哪里。。。我已经掉进去好几次了。。。好像还在持续的掉。。nnd。。。
>>>
>>> --
>>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>>
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>
>
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: 回复: Re:[PerlChina] 热图中的色阶问题

得要知道你想要到�果
本身 RGB 就是�值,以 RRGGBB 的形式�成
所以就一� 24bit �值而言,就能�� RGB值
因此 24bit 的�值�成 RGB值可以直接�成�
$int = 0xffffff;
$r = $int >> 16;
$g = $int >> 8 & 0xff;
$b = $int & 0xff;

-------- Original Message --------
Subject: 回复: Re:[PerlChina] 热图中的色阶问题
From: zehui.hug <zehui.hug@gmail.com>
To: perlchina <perlchina@googlegroups.com>
Date: 6/8/2012 22:50
谢谢啊,是个办法。但是PS中红色(255,0,0)到绿色(0,255,0)的渐变的话,不是线性的。最为明显的就是他的渐变 中,蓝色不会一直是0. 不知道perl里可有其他更优的呢?
呵呵,没有也不要紧,我觉得这个简单的差值渐变基本能满足我的要求了,谢谢!
 

zehui.hug
 
发件人: Huangj
发送时间: 2012-08-06 21:05
收件人: perlchina
主题: Re:[PerlChina] 热图中的色阶问题
用绘图软件的调色板看看绿色的颜色值,再看看红色的颜色值,取差值,直接除以100


在 2012-08-06 19:28:25,"zehui.hug" <zehui.hug@gmail.com> 写道:
 
各位前辈,大家好。本人菜鸟一个,请教一个问题。我想做一个热图,希望不同的数值对应不同颜色。比如说0是绿 色,100是红色,之间的数值分别对应从绿到红的渐变色。
这个颜色值在perl中怎么取得呢?有没有一个"色阶函数"之类的可以直接计算呢?(用的SVG的包作图)
 
提问的业余之处请多包涵,谢谢大家 :)

zehui.hug

Re: Re:Re: [PerlChina] 一个坑,自己掉进去好几次了。。。

新手求教什麽坑?



-- Sent from my HP TouchPad

On 6 Aug 2012 21:09, Huangj <redspid@163.com> wrote:
俺都介么写
 
my $y;
unless ( $y ) { print 1; }



在 2012-06-29 13:19:39,"joe jiang" <lamp.purl@gmail.com> 写道:
  DB<7> print 1 if !defined $a or $a == 0;
1


2012/6/29 cnhack TNT <cnhacktnt@gmail.com>
同掉过,路过。。。



2012/6/29 wd <wd@wdicc.com>
#!/usr/bin/perl

use strict;
use warnings;

my $a;

if ( not defined $a || $a == 0 ) {
   print 1;
}

就这段代码。。明眼人应该能看明白错在哪里。。。我已经掉进去好几次了。。。好像还在持续的掉。。nnd。。。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: 回复: Re:[PerlChina] 热图中的色阶问题

其实我觉得渐变可以blue都是0啊,为什么blue要变呢?是blue不变的话那种颜色比较难看?
On 2012年08月06日 22:50, zehui.hug wrote:
谢谢啊,是个办法。但是PS中红色(255,0,0)到绿色(0,255,0)的渐变的话,不是线性的。最为明显的就是他的渐变 中,蓝色不会一直是0. 不知道perl里可有其他更优的呢?
呵呵,没有也不要紧,我觉得这个简单的差值渐变基本能满足我的要求了,谢谢!
 

zehui.hug
 
发件人: Huangj
发送时间: 2012-08-06 21:05
收件人: perlchina
主题: Re:[PerlChina] 热图中的色阶问题
用绘图软件的调色板看看绿色的颜色值,再看看红色的颜色值,取差值,直接除以100


在 2012-08-06 19:28:25,"zehui.hug" <zehui.hug@gmail.com> 写道:
 
各位前辈,大家好。本人菜鸟一个,请教一个问题。我想做一个热图,希望不同的数值对应不同颜色。比如说0是绿 色,100是红色,之间的数值分别对应从绿到红的渐变色。
这个颜色值在perl中怎么取得呢?有没有一个“色阶函数”之类的可以直接计算呢?(用的SVG的包作图)
 
提问的业余之处请多包涵,谢谢大家 :)

zehui.hug
--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

回复: Re:[PerlChina] 热图中的色阶问题

谢谢啊,是个办法。但是PS中红色(255,0,0)到绿色(0,255,0)的渐变的话,不是线性的。最为明显的就是他的渐变中,蓝色不会一直是0. 不知道perl里可有其他更优的呢?
呵呵,没有也不要紧,我觉得这个简单的差值渐变基本能满足我的要求了,谢谢!
 

zehui.hug
 
发件人: Huangj
发送时间: 2012-08-06 21:05
收件人: perlchina
主题: Re:[PerlChina] 热图中的色阶问题
用绘图软件的调色板看看绿色的颜色值,再看看红色的颜色值,取差值,直接除以100


在 2012-08-06 19:28:25,"zehui.hug" <zehui.hug@gmail.com> 写道:
 
各位前辈,大家好。本人菜鸟一个,请教一个问题。我想做一个热图,希望不同的数值对应不同颜色。比如说0是绿色,100是红色,之间的数值分别对应从绿到红的渐变色。
这个颜色值在perl中怎么取得呢?有没有一个"色阶函数"之类的可以直接计算呢?(用的SVG的包作图)
 
提问的业余之处请多包涵,谢谢大家 :)

zehui.hug

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re:Re: [PerlChina] 一个坑,自己掉进去好几次了。。。

俺都介么写
 
my $y;
unless ( $y ) { print 1; }



在 2012-06-29 13:19:39,"joe jiang" <lamp.purl@gmail.com> 写道:
  DB<7> print 1 if !defined $a or $a == 0;
1


2012/6/29 cnhack TNT <cnhacktnt@gmail.com>
同掉过,路过。。。



2012/6/29 wd <wd@wdicc.com>
#!/usr/bin/perl

use strict;
use warnings;

my $a;

if ( not defined $a || $a == 0 ) {
   print 1;
}

就这段代码。。明眼人应该能看明白错在哪里。。。我已经掉进去好几次了。。。好像还在持续的掉。。nnd。。。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re:[PerlChina] 热图中的色阶问题

用绘图软件的调色板看看绿色的颜色值,再看看红色的颜色值,取差值,直接除以100


在 2012-08-06 19:28:25,"zehui.hug" <zehui.hug@gmail.com> 写道:
 
各位前辈,大家好。本人菜鸟一个,请教一个问题。我想做一个热图,希望不同的数值对应不同颜色。比如说0是绿色,100是红色,之间的数值分别对应从绿到红的渐变色。
这个颜色值在perl中怎么取得呢?有没有一个"色阶函数"之类的可以直接计算呢?(用的SVG的包作图)
 
提问的业余之处请多包涵,谢谢大家 :)

zehui.hug

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。


--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

[PerlChina] 热图中的色阶问题

 
各位前辈,大家好。本人菜鸟一个,请教一个问题。我想做一个热图,希望不同的数值对应不同颜色。比如说0是绿色,100是红色,之间的数值分别对应从绿到红的渐变色。
这个颜色值在perl中怎么取得呢?有没有一个"色阶函数"之类的可以直接计算呢?(用的SVG的包作图)
 
提问的业余之处请多包涵,谢谢大家 :)

zehui.hug

2012年8月5日星期日

[PerlChina] Fwd: [Perlweekly] #54 - WebGUI, Dada Mail, Sqitch releases



---------- Forwarded message ----------
From: Gabor Szabo <gabor@szabgab.com>
Date: Mon, Aug 6, 2012 at 12:17 PM
Subject: [Perlweekly] #54 - WebGUI, Dada Mail, Sqitch releases
To: perlweekly@perlweekly.com


Perl Weekly

Issue #54 - August 6, 2012 - WebGUI, Dada Mail, Sqitch releases

You can read the newsletter on the web, if you prefer.

Hi,

I don't have much to say this week. Let's see what other people wrote:

Announcements

Announcing Galileo - A minimal but modern CMS
I think there are lots of Content Management Systems written in Perl, but none of them are really well known. Now that Joel Berger has released his new CMS, I wonder if this can break into the world of high-profile CMSes? Does Joel want to invest the time and energy in the promotion part as well? Does he want to make a business around it?

50% off O'Reilly Perl Ebooks
I was not sure if I want to promote O'Reilly, after all the money spent on them might be money not spent on Perl Maven books. In the end, I think if you wanted to buy a Perl book from O'Reilly and you can buy it for half the price, then why not? Just note, it is only till August 9, 2012

Articles

Investing in Infrastructure
Some good reasons why a company should contribute back to the Perl ecosystem. Unfortunately, many think 'it will work without us' or feel entitled to all the free code regardless of their action. It seems - to me - the higher up someone on the management ladder - the shorter s/he can see ahead.

Hash to string race
Sebastien Willing has compared 9 ways of stringification (or serialization or marshalling). See his benchmarks.

How to calculate the balance of bank accounts in a CSV file, using Perl?
One of the readers of the Perl 5 Maven site sent me a CSV file with some bank account details, and a script parsing it. Badly. I took the opportunity and showed how to refactor the code step-by-step. I hope it will help some other people as well.

Releases

WebGUI 7.10.25 released

Dada Mail v5.2.0 Released

Sqitch v0.80: Now With More You
This isn't just theory any more, David E. Wheeler released a fairly usable version of the Sqitch, the simple database change management system. It was nice following along his posts during the development, and see the usable release of the product. Now comes the hard part. Getting the word out. You could help him in this even more. Try Sqitch and write about it, or share the link to the article.

Testing

Elapsed Time in Test Output
Sometimes it is useful to see how long each step in a test script took.

Code

On writing a new Perl Debugger (Part 1 - Why?)
Rocky Bernstein has started a new debugger for Perl. This the first part of an already 3-part long series of articles describing not only why he is building a new debugger, but also what can we expect to find in it. I think writing about the debugger as he is developing it can be one of the critical pieces, that can make the new debugger more popular than the previous ones.

AnyEvent::Capture - Synchronous calls of async APIS

Perils of Plugins

Editors and IDEs

Perl Editor
This is the second part of the Perl Maven Tutorial. It is fun to see how every time editors are mentioned, the number of comments jump. People really care about their editors. (Maybe I should write about indentation as well :).

Grants

Interim Grant Report: Lists, Iterators, and Parcels
After a very long period, finally Patrick Michaud provides a new report on his progress.

Cooking Perl with Chef - Grant Report #4
David Golden is back working full time on the grant. He also created a new web site for Perl and Chef and there is a mailing list for the DevOps using Perl. There is even a screencast for Cooking Perl with Chef.

Polls

A Quick Update On The Catalyst Poll
Surely more than 300 of the Perl Weekly readers have some opinion (good or bad) on Catalyst? John Napiorkowski is looking for both current users of Catalyst and people who have not used it yet or already left it for some other framework or even some other language. (Though I guess the last group won't read this newsletter anyway.)

Perl 6

The finished game
After a month of blogging, Carl Masak has finished the game. If you have been waiting it to be finished before you start reading, then it's your turn now!

Niecza Perl 6 v20 released

Is a value IN a given list of values?
Introducing junctions and the any(), all(), none(), one() functions.

Looping over a list of values one at a time, two at a time and more
How can you get every 3 elements of an array? How can you merge two arrays together like a zip? Introducing the big Z operator!

Weekly collections

MetaCPAN favourites weekly report

Perl 5 Porters Weekly: July 23-July 29, 2012
The message that finally 5.16.1 is unblocked and why there was no interest in adding more documentation to the core Perl.

stackoverflow perl report

Events

I usually list the next 3-4 events here. The list of all the events can be found on the web site. If your Perl event is not listed there, please let me know.

YAPC::EU 2012
August 20-22, 2012, Frankfurt, Germany

YAPC::Asia Tokyo 2012
September 27-29, 2012, Tokyo, Japan

Portuguese Perl workshop (PTPW)
September 28, 2012, Braga, Portugal

You joined the Perl Weekly to get weekly e-mails about the Perl programming language and related topics.
Want to see more? See the archives of all the issues.
Reading this as a non-subscriber? click here to join us free of charge.
(C) Copyright Gabor Szabo. The articles are copyright the respective authors.

You can unsubscribe here if you don't want to receive mails any more.

You can freely redistribute this message if you keep the whole message intact, including the Copyright notice and this text.


_______________________________________________
Perlweekly mailing list
Perlweekly@perlweekly.com
http://mail.perlweekly.com/mailman/listinfo/perlweekly




--
Fayland Lam // http://www.fayland.org/

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。