in reply to GetOptions Help Needed
Without reading your code too close, I think it is because your decon_server subroutine gets called too early:
my %options = ( ... "decon" => \&decon_server, ); ... die_usage() if (!GetOptions(%options));
decon_server will get called from within GetOptions(), which is too early since none of the connection setup has happened yet.
I would suggest that the approach of setting a flag, as used in the other options, is likely better:
my %options = ( ... "decon" => \my $do_decon_server, ); ... die_usage() if (!GetOptions(%options)); ... if( $do_decon_server ) { decon_server(); };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: GetOptions Help Needed
by MysticElaine (Novice) on Aug 20, 2018 at 16:19 UTC |