Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^6: In place search and replace with a hashby LanX (Saint) |
on Dec 28, 2014 at 03:42 UTC ( [id://1111515]=note: print w/replies, xml ) | Need Help?? |
> ? Well AnoMonk said "single quotes ... prevent variable interpolation" that's misleading.
updatemaybe clearer with an example
single quotes on the RHS of s/// never prevent interpolation. Interpolation is the process to translate "$a $h{$b}" to $a . " " . $h{$b} at compile time. But the keys of a hash-fetch are not interpolated they are executed, otherwise something like $h{$a$b} wouldn't cause a syntax error.
Cheers Rolf (addicted to the Perl Programming Language and ☆☆☆☆ :)
In Section
Seekers of Perl Wisdom
|
|