in reply to Command line options
I usually do it the other way round:
Naturally you would change the assignment above if, for example, 0, was a legal value for opt1, otherwise if the user puts in 0 then either the env var or 'default' will get used.GetOptions(\%opts, 'opt1=s', 'opt2=i',...); $opts{'opt1'} ||= ($ENV{OPT1} || 'default');
In Section
Seekers of Perl Wisdom