in reply to passing parameters from the command line
can you just use:
$opt = $ARGV[0] || "default value for option";
instead of shift or is there something else going on in your script that requires you to use shift?
In Section
Seekers of Perl Wisdom