note
BrowserUk
<blockquote><i></i></blockquote>
<p>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:<c>Can't modify non-lvalue subroutine call ...</c> If it exists and is an lvalue sub, it would assign the address of the anonymous sub to its target lvalue.
<p>This <c>$x = 'color'; *{$x} = sub {#do something};</c> is equivalent to <c>sub color { #do something };</c>
<div class="pmsig"><div class="pmsig-171588">
<hr />
<font size=1 >
<div>Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.</div>
<div>"Science is about questioning the status quo. Questioning authority". </div>
<div>In the absence of evidence, opinion is indistinguishable from prejudice.</div>
<div>[http://www.theregister.co.uk/2010/04/12/farewell_guy/|RIP an inspiration; A true Folk's Guy]</div>
</font>
</div></div>
869369
869369