Need help passing variables in shell script to perl one-liner

I'm writing a script to automate some post-install tasks on RHEL4 servers.
I need the following code to insert an 'A' in the middle of a string, then replace the string in a file. I know I can use sed to do this, but I'd like to use perl's in place edit so I don't have to write to a temp file, then overwrite the original.

Here's what I have so far:

mystr1=`grep Mlocal submit.cf | cut -d, -f3` #grab the string
mystr2=`echo $mystr1 | awk '{print substr($1,1,7) "A" substr($1,8)}'` #insert the 'A'
perl -i -p -e 's/$mystr1/$mystr2/' submit.cf #search and replace

The variables (mystr1 and mystr2) are not importing into the perl statement. I've tried exporting them with 'typeset -x' and using:

perl -i -p -e 's/$ENV{"mystr1"}/$ENV{"mystr2"}/' submit.cf #search and replace

Which works with:
perl -e 'print $ENV{"mystr2"}'
but not with search and replace

I know the search and replace syntax is correct because the following section of my script to uncomment the alias file works fine:

if [ `grep AliasFile submit.cf | cut -c1` = "#" ]
then
perl -i -p -e "s/#O AliasFile/O AliasFile/" submit.cf
fi

Any help is greatly appreciated.

The shell don't expand variables within single quotes, try double quotes:

perl -i -p -e "s/$mystr1/$mystr2/" submit.cf #search and replace

Regards