Yes, you are missing something really simple here. It's called interpolation and it happens inside double quotes. Put this in a script and run it.
$x=1;
print 'single quoted dollar x is $x';
print "\n";
print "double quoted dollar x is $x";
print "\n";
perl -e '