Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save earnhardt3rd/ee880eb0b34b681c9c7cf7bb1f566c5b 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_ROOT_PATH();}
1;
sub _SETUP_ROOT_PATH {
my $PATH_TAG = shift || "";
if ($PATH_TAG eq "") {return "Invalid Config Tag!";}
my $ROOT_VAL="";
print " _SETUP_ROOT_PATH($PATH_TAG)\n";
if (exists($ROOTS{$PATH_TAG})) {
$ROOT_VAL=$ROOTS{$PATH_TAG};
print " --ROOT_TAG FOUND:$ROOT_VAL\n";
if (uc($MODE) eq "CRON") {return $ROOT_VAL;}
} else {
print " --ROOT_TAG NOT FOUND\n";
&_FH_ROOTS();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment