Thanks for the advice, but in this case there is not flexability in the way the script is called. It's an email handler which gets called via sendmail's aliases files. The aliases entry is:
"|wrapper myscript.pl address"
Where wrapper is the script wrapper, and address is the specific alias (many aliases use this one script).