How do I make my program run with sh and csh?

See the eg/nih script (part of the perl source distribution).