哦,可以了,刚才我搞错了 在 2011年1月13日 下午11:38,方伟 <[email protected]> 写道: > 不行,还是一样的输出结果 > > 在 2011年1月13日 下午11:31,Robin Lee <[email protected]> 写道: >> while(<DATA>) >> {chomp; >> print "$_$&\n" if /L..y/; >> } >> >> 这样的话就能输出你所估计的结果。 >> >> 2011/1/13 方伟 <[email protected]> >>> >>> use warnings; >>> while(<DATA>) >>> {print if /L..y/; >>> print $& if /L..y/; >>> } >>> __DATA__ >>> My name is Lucy. >>> My name is Jack. >>> My name is Lily. >>> ############ >>> 打印结果是: >>> My name is Lucy. >>> LucyMy name is Lily. >>> Lily >>> 我的疑惑是,打印结果怎么不是这样的呢: >>> My name is Lucy.Lucy >>> My name is Lily.Lily >>> >>> -- >>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。 >>> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 >>> 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 >>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 >>> >> >> -- >> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。 >> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 >> 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 >> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 >> >
-- 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
