in reply to
s/this/$that/ Gives Variable Name, Not Contents of Variable
The behavior you describe would be possible if you were escaping the $. Is that really your code, or do you actually have:
s/XXYY/\$foo/;
[download]
Comment on
Re: s/this/$that/ Gives Variable Name, Not Contents of Variable
Download
Code
In Section
Seekers of Perl Wisdom