in reply to what does the brace do
${$var} means
"the scalar variable referenced by the reference in $var." or
"the scalar package variable referenced by the name in $var."
my $some_scalar = 'abc'; my $ref = \$some_scalar; print $ref, "\n"; # SCALAR(0x225e9c) print ${$ref}, "\n"; # abc
$some_scalar = 'abc'; my $name = 'some_scalar'; print $name, "\n"; # some_scalar print ${$name}, "\n"; # abc
See perlref for the former, and Why it's stupid to "use a variable as a variable name" for the latter.
|
|---|