my $broadcastTime = 10;
-sub discover ($) {
+sub discover($) {
my ($broadcast) = @_;
my $startTime = time;
} # unless
} # if
- last
- if (time () - $startTime) > $broadcastTime;
+ last if (time() - $startTime) > $broadcastTime;
} # while
verbose "$broadcastTime seconds has elapsed - discovery complete";
} # discover
# Main
-my $broadcastAddress = inet_ntoa (INADDR_BROADCAST);
+my $broadcastAddress = inet_ntoa(INADDR_BROADCAST);
-GetOptions (
+GetOptions(
usage => sub { Usage },
verbose => sub { set_verbose },
debug => sub { set_debug },
'broadcastAddr=s' => \$broadcastAddress,
) or Usage "Invalid parameter";
-Usage 'Extraneous options: ' . join ' ', @ARGV
- if @ARGV;
+Usage 'Extraneous options: ' . join ' ', @ARGV if @ARGV;
# Announce ourselves
verbose "$FindBin::Script V$VERSION";
verbose_nolf 's' if $nbrHosts != 1;
verbose " on subnet $broadcastAddress";
-foreach (sort values %hosts) {
- my $verbose = get_verbose () ? '-verbose' : '';
+for (sort values %hosts) {
+ my $verbose = get_verbose() ? '-verbose' : '';
my ($status, @output) = Execute "updatesystem.pl -host $_ $verbose";
- error "Unable to update host $_ (Status: $status)\n"
- . join ("\n", @output), 1
- if $status;
+ error "Unable to update host $_ (Status: $status)\n" . join ("\n", @output), 1 if $status;
verbose join "\n", @output;
-} # foreach
+} # for
=pod