We can more miraculously set
|
$name="foo"; # define an innocent ascii string
|
${$name} = 6; # sets $foo=6 as though $name was a symbolic reference
|
$$name = 6; # also sets $foo=6
|
$name->[0] = 4; # sets $foo[0] = 4
|
${$name x 2} = 6; # sets $foofoo = 6 ; # remember definition of x for strings
|
@$name = (); # sets @foo to null list while
|
&$name(arguments); # calls subroutine foo with given arguments!
|
use strict 'refs'; # FORBIDS symbolic references and above syntax will lead to error messages
|
*PI =\3.14159; # ensures that $PI is set in a way that you can not override it!
-
i.e. $PI = 3; # generates an error
|