No. Your second example attempts to assign an anonymous subroutine to an lvalue sub called 'color'. If there is a sub called 'color' and it is not an lvalue sub you'll get:Can't modify non-lvalue subroutine call ... If it exists and is an lvalue sub, it would assign the address of the anonymous sub to its target lvalue.
This $x = 'color'; *{$x} = sub {#do something}; is equivalent to sub color { #do something };
In reply to Re: typeglob/symbolic reference question
by BrowserUk
in thread typeglob/symbolic reference question
by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |