That sounds about right. The only problem is that I can't leave it outside the quotes**, since it's going to be in a system() call for the real script. If anyone can remember how to escape a full reference string like that, I'd be very grateful.
** Of course, I can simply read the value into a scalar variable and put that into the system() call, but it seems so inefficient. :)