in reply to how do i use module vars while using use strict; ?

The variables that getopts sets are package variables, not lexical variables. You can't declare them with my, you have to use use vars or use their full names (e.g. $main::opt_h>).

Personally, I like to use the version of getopts that takes a reference to a hash and puts the values in there.

#!/usr/bin/perl -w use strict; use Getopt::Std; my %opt; getopts('hd:t', \%opt); my ($num_days, $dait, $today); # local vars used later if ( $opt{d} ) { $num_days = $opt{d}; } print ("num_days = $num_days\n");
--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me