commit 775844561ba2f7a45245fad772e08406426c9b7b
parent 46bec27765bc522714634694db8b5a9113631b85
Author: Jacob Pipkin <j@dawnrazor.net>
Date: Thu, 31 May 2012 19:01:29 -0500
replace some for and if statements with their postscript forms
Diffstat:
3 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm
@@ -61,9 +61,7 @@ if (-f $conf_file) {
}
# undef any invalid $key=$value pairs
for my $key (keys %config) {
- unless ($key ~~ @valid_conf_keys) {
- undef $config{$key};
- }
+ undef $config{$key} unless $key ~~ @valid_conf_keys;
}
# ensure we have sane configs, and defaults for anything not in the conf file
for my $key (@valid_conf_keys) {
@@ -320,9 +318,8 @@ sub get_sbo_downloads {
@md5s = find_download_info ($sbo, $location, 'md5sum', 0);
}
my @downloads;
- for my $key (keys @links) {
- push (@downloads, {link => $links[$key], md5sum => $md5s[$key]} );
- }
+ push (@downloads, {link => $links[$_], md5sum => $md5s[$_]} )
+ for keys @links;
return @downloads;
}
diff --git a/sboconfig b/sboconfig
@@ -50,9 +50,7 @@ show_version () and exit (0) if exists $options{v};
if (exists $options{l}) {
my @keys = sort {$a cmp $b} keys %config;
- for my $key (@keys) {
- print "$key=$config{$key}\n";
- }
+ print "$_=$config{$_}\n" for @keys;
exit 0;
}
diff --git a/sbofind b/sbofind
@@ -96,9 +96,7 @@ if (exists $findings[0]) {
push (@listing, "\n");
}
}
- for my $list (@listing) {
- print $list;
- }
+ print $_ for @listing;
} else {
print "Nothing found for search term: $search\n";
}