in reply to Automatically prepare code for perl -e

I might not understand the question, but the obvious answer (to me anyway) is to put code in shell variables Like so:

#!/bin/sh MESSAGE='Hello World\n' perl -e "print \"$MESSAGE\""

(I'm not sure if '\n' gets expanded by the shell, so this example might not exactly work, but it shows the principle.)

Is that what you're asking for, or did I misunderstand the question?

-Pileofrogs