Skip to content

Instantly share code, notes, and snippets.

@earnhardt3rd
Created June 19, 2023 14:03
Show Gist options
  • Select an option

  • Save earnhardt3rd/617c8c151e41aba28715ee58264772d3 to your computer and use it in GitHub Desktop.

Select an option

Save earnhardt3rd/617c8c151e41aba28715ee58264772d3 to your computer and use it in GitHub Desktop.
require 'getopts.pl';
Getopts('m:d:t');
my $MODE = uc($opt_m) || "";
my $DEBUG = $opt_d || 0;
if (defined $opt_t) { my %TEST = &_SETUP_CONFIG_PATH();}
1;
sub _SETUP_CONFIG_PATH {
my $PATH_TAG = shift || "";
if ($PATH_TAG eq "") {return "Invalid Config Tag!";}
my $CFG_VAL="";
if (exists($CONFIG{$PATH_TAG})) {
$CFG_VAL=$CONFIG{$PATH_TAG};
if (uc($MODE) eq "CRON") {
if (!exists($ROOTS{$PATH_TAG})) {
$ROOTS{$PATH_TAG}=$CFG_VAL;
}
return $CFG_VAL;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment