diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-05-31 19:01:29 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-05-31 19:01:29 -0500 |
commit | 775844561ba2f7a45245fad772e08406426c9b7b (patch) | |
tree | 63025a8708ad15023c9ab408fc74fb252c588d32 | |
parent | 46bec27765bc522714634694db8b5a9113631b85 (diff) | |
download | sbotools2-775844561ba2f7a45245fad772e08406426c9b7b.tar.xz |
replace some for and if statements with their postscript forms
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 9 | ||||
-rwxr-xr-x | sboconfig | 4 | ||||
-rwxr-xr-x | sbofind | 4 |
3 files changed, 5 insertions, 12 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 4b96117..389b6a7 100644 --- 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; } @@ -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; } @@ -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"; } |