in reply to Macro in perl code?

pileofrogs,
You may find Inline subs? of interest.

Cheers - L~R