lvalue subとPerl debugger
iandeth.さんのところで「lvalue がデバッグモードで正しく動作しない」という話を読んで興味を覚えたので「perl lvalue debugger attribute」なんてキーワードでちょろっと検索。とりあえずOOToolsなどのPODに既知の問題として紹介されていますね。
KNOWN ISSUE
Due to the perl bug #17663 (Perl 5 Debugger doesn't handle properly lvalue sub assignment), you must know that under the -d switch the lvalue sub assignment will not work, so your program will not run as you expect.
In order to avoid the perl-bug you have 3 alternatives:
- patch perl itself as suggested in this post: http://www.talkaboutprogramming.com/group/comp.lang.perl.moderated/messages/13142.html (See also the cgi-builder-users mailinglist about that topic)
- use the lvalue sub assignment (e.g. $s->any_property = 'something') only if you will never need -d
- if you plan to use -d, use only standard assignments (e.g. $s->any_property('something'))
Maybe a next version of perl will fix the bug, or maybe lvalue subs will be banned forever, meanwhile be careful with lvalue sub assignment.
で、そのPODの元になったperl.perl5.portersのメールがこれで、
もっと詳しく知りたい人はPerlbugで7013というチケットを検索するか、ログインしてからlvalueで検索すると詳細なやりとりを読めますよ、と。