Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Perl best practices fanatismby chromatic (Archbishop) |
on Dec 09, 2007 at 06:15 UTC ( [id://655932]=note: print w/replies, xml ) | Need Help?? |
I have testing code (Parrot::Test, for example) that sometimes needs to mark a test as TODO, but for various reasons can't set the appropriate package variable. In the case of Parrot, this is because the code being tested is not Perl. Thus the library contains a line something like: local ${ $package . '::TODO' } = $opts{todo} if $opts{todo};This construct is very different than the conditional declaration of a lexical variable because local only controls the visibility of a symbol's binding. The unbinding always occurs at the end of the scope if the conditional is true. Unlike lexical bindings, the false condition does not interfere with unbinding. xdg is right, and it does appear fixed. Nice!
In Section
Meditations
|
|