From 775844561ba2f7a45245fad772e08406426c9b7b Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Thu, 31 May 2012 19:01:29 -0500 Subject: replace some for and if statements with their postscript forms --- SBO-Lib/lib/SBO/Lib.pm | 9 +++------ sboconfig | 4 +--- 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; } diff --git a/sboconfig b/sboconfig index beaa719..63f1d51 100755 --- 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 index e32d940..3bae022 100755 --- 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"; } -- cgit v1.2.3