# Anything to the left of a # => is treated as like it's 'single quoted' # That means variables are not interpolated.
Variables are interpolated on the left of a =>. E.g.
perl -MData::Dumper -le '$foo = "blah"; %a = ( $foo => 42 ); print Dumper \%a' $VAR1 = { 'blah' => 42 };
Hooray for DWIMery.
Update: Fixed formatting
In reply to Re^2: passing a variable as a string
by friedo
in thread passing a variable as a string
by coldfingertips
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |