From a0e2ba3610d81c74096ae7f02d7b3f61abceb43e Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 2 Aug 2021 04:57:52 -0700 Subject: [PATCH] Interpreter: minor comments about getopt --- lib/PBot/Core/Interpreter.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/PBot/Core/Interpreter.pm b/lib/PBot/Core/Interpreter.pm index 03d39edb..d6fee0cd 100644 --- a/lib/PBot/Core/Interpreter.pm +++ b/lib/PBot/Core/Interpreter.pm @@ -1388,7 +1388,7 @@ sub getopt { } # getopt_from_string() uses our split_line() function instead of -# GetOpt::Long::GetOptionsFromString's Text::ParseWords +# Getopt::Long::GetOptionsFromString's Text::ParseWords sub getopt_from_string { my ($self, $string, $result, $config, @opts) = @_; @@ -1397,9 +1397,11 @@ sub getopt_from_string { return $self->getopt_from_array(\@opt_args, $result, $config, @opts); } +# the workhorse getopt function sub getopt_from_array { my ($self, $opt_args, $result, $config, @opts) = @_; + # emitting errors as Perl warnings instead of using die, weird. my $opt_error; local $SIG{__WARN__} = sub { $opt_error = shift;