應該是perl的官方定義有所改變吧…… 我記得我之前在perl 5.8.x(忘了子版本)上使用正則,該正則不能通過時,$1 $2 等不會被從設 而看你們的對話中perl 5.10 中因 該正則不能通過時,$1 $2會被undef成 uninitialized 其實有此改變應該也合乎情理的,也談不上是否bugs,只是不同版本的定義有所不 同而已
-------- Original Message -------- Subject: [PerlChina] Re: 请教一个正则表达式的问题 From: Lee Duhem <[email protected]> To: [email protected] Date: 25/7/2009 21:40 > 2009/7/25 Cheese <[email protected]>: > >> 看看你引用的那段的前一段: >> The numbered match variables ($1, $2, $3, etc.) and the related >> punctuation set ($+, $&, "$`", "$'", and $^N) are all >> dynamically >> scoped until the end of the enclosing block or until the next >> successful match, whichever comes first. (See "Compound >> Statements" in >> perlsyn.) >> >> > > 你想说明什么?你能用这个解释 perl 5.10.0 在这里的行为么? > 另外,这段话在 perl 5.8.8 的 perlre 中也是有的,你又如何用它来解释 > perl 5.8.8 在这里的行为? > > lee > > > > -- Best Regards, Anthony WU --~--~---------~--~----~------------~-------~--~----~ 您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。 要在此论坛发帖,请发电子邮件到 [email protected] 要退订此论坛,请发邮件至 [email protected] 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛 -~----------~----~----~----~------~----~------~--~---
