Is there any reason that you are writing a shell script rather than making it a pure perl script in the first place?
Assuming there is, using double quotes to allow shell interpretation (as suggested by the pusher robot) is one way to do it, but it could get messy if you find yourself wanting both shell and perl variables.
You could set the variables directly in the perl rather than use shell variables in the first place.
Or, you could write your perl one-liner to read them off the command line.
perl -spe 's/mymodel/$model/' -- -model=1200 mytext.txt
You could use -model=$model in that example. And maybe you'd like to avoid using the same variable names in both perl and the shell...
perl -spe 's/mymodel/$arg/' -- -arg=$model mytext.txt
-sauoq
"My two cents aren't worth a dime.";
|