# Print perldoc for this script and exit if 'help' option is detected.#pod2usage({-exitval => 0, -verbose => 2}) if $opt{'h'};## Check --test option.#$config->{'count_run'} = !defined($opt{'c'}) ? 0 : 1;usage_error("The -ifile option is required.") if !defined($opt{'f'});## Check if ifile option is provided.#usage_error("The -ifile option is required.") if !defined($opt{'f'});$config->{'ifile'} = $opt{'f'};$config->{'ifile'} =~ s/\s//g;## Check Input file#usage_error("Input file $config->{'ifile'} does not exist.") if !-e $config->{'ifile'};## Default VPRR directory to /ftp/edgar/vprr if --vprr_dir option is not provided.#$config->{'vprr_dir'} = !$opt{'d'} ? '/ftp/edgar/vprr' : $opt{'d'};## Validate the VPRR directory#usage_error("Directory $config->{'vprr_dir'} does not exist.") if !-d $config->{'vprr_dir'};usage_error("Directory $config->{'vprr_dir'} is not accessable.")if !opendir(DIR, $config->{'vprr_dir'});closedir(DIR);## Set up the output filename#my ($mday, $mon, $year) = (localtime(time()))[3,4,5];$year += 1900;$mon++;$config->{'outfile'} = basename($0, '.pl') . '.' .sprintf("%04d-%02d-%02d", $year, $mon, $mday) .'.out';if (!$config->{'count_run'}) {
Add a Comment