in reply to Re^4: RFC: beginner level script improvement
in thread RFC: beginner level script improvement
### SUB validate_command_line_args ### DOES: perform various sanity + checks on command line argume +nts ############# sub validate_command_line_args { my ($name,$prompt,$configf,$quiet,$outf,$debug,$batchsize,$proto,$ +tacacs,$verbose,$header,$maild +st,$path) = @{ $_[0] }; ... if ( $batchsize > 30 ){ warn("$0:WARNING: More than 25 simultanous connections are NOT + allowed!\nReducing Max_Connec +tions to 25.\n"); $batchsize=25; }elsif ( $batchsize < 0 ){ warn("$0:WARNING: Negative Max_Connections are not permitted, +forking has been disabled.\n") +; $batchsize = 0; } }
The $batchsize variable is lexically scoped to this subroutine so changing its value will have no effect on anything outside this subroutine.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: RFC: beginner level script improvement
by georgecarlin (Acolyte) on Sep 30, 2013 at 15:55 UTC |