2012年5月17日星期四

Re: [PerlChina] more than one way in perl

Think this is related to your logic inside the subroutine1, please check why there are many lines of eval and 1>1

On Thu, May 17, 2012 at 5:05 PM, Haiyan Lin <linhy0120@gmail.com> wrote:
Hi, perlers,

Supposing I have a hash reference in hand, the effect of the following two statements

$hash1_ref = &subroutine1( $hash0_ref, 'parameter1' );
$hash2_ref = &subroutine1( $hash1_ref, 'parameter2' );

will save elements in $hash0_ref, stafisfying both parameter1 and parameter2, into $hash2_ref.

I try to do this by following one statement, but I failed.

$hash_ref2 = &subroutine1( &subroutine1( $hash0_ref, 'parameter1'), 'paratemter2') ;

any help? THANKS in advance

==================================================
下面的语句可以得到$hash0_ref中同时满足parameter1 和parameter2的结果,并放到$hash2_ref中。
$hash1_ref = &subroutine1( $hash0_ref, 'parameter1' );
$hash2_ref = &subroutine1( $hash1_ref, 'parameter2' );


现在我换一种写法,理论上,可以得到相同的结果,但报错了。请高高手指导。谢谢

$hash_ref2 = &subroutine1( &subroutine1( $hash0_ref, 'parameter1'), 'paratemter2') ;




Haiyan Lin

--
您收到此邮件是因为您订阅了 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 访问此网上论坛。

没有评论: