Created
June 19, 2023 14:04
-
-
Save earnhardt3rd/386fa27f8efcf14160659909671faeb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'getopts.pl'; | |
Getopts('m:d:t'); | |
my $MODE = uc($opt_m) || ""; | |
my $DEBUG = $opt_d || 0; | |
if (defined $opt_t) { my %TEST = &_WARNING();} | |
1; | |
sub _WARNING { | |
my $warnMsg = shift || ""; | |
if ($warnMsg eq "") {return;} | |
if (defined($WARN_FILE)) { | |
if (! -f $WARN_FILE) { | |
open (WFH,"> $WARN_FILE"); | |
print WFH "DATE :$DT\n"; | |
print WFH "TIME :$TM\n"; | |
print WFH "USER :$USERNAME\n"; | |
print WFH "ACTION :$action\n"; | |
print WFH "------------------------------------\n"; | |
close(WFH); | |
} | |
if (-f $WARN_FILE) { | |
&displayMessageInBox($warnMsg) if $DEBUG > 0; | |
open (WFH,">> $WARN_FILE"); | |
print WFH "$warnMsg\n"; | |
close(WFH); | |
} | |
} else { | |
print " WARN_FILE NOT DEFINED!\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment