diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-11-04 08:32:03 -0600 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-11-04 08:32:03 -0600 |
commit | 23751d7cf1774684214ce7f210456d74f5eb683a (patch) | |
tree | e4107582889cd1cbfc6f1f29fce8f8d37098274b | |
parent | 115d15c04a36dd01af39ae99e0ce9016fbba1551 (diff) | |
download | sbotools2-23751d7cf1774684214ce7f210456d74f5eb683a.tar.xz |
also handle being passed an array ref
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 21f62c6..4ad01e5 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -222,6 +222,7 @@ sub get_inst_names ($) { sub get_sbo_location { exists $_[0] or script_error 'get_sbo_location requires an argument.'; my @sbos = @_; + @sbos = $sbos[0] if ref $sbos[0] eq 'ARRAY'; state $loc_store = {}; # if scalar context and we've already have the location, return it now. unless (wantarray) { @@ -233,6 +234,7 @@ sub get_sbo_location { my $regex = qr#LOCATION:\s+\.(/[^/]+/\Q$sbo\E)$#; while (my $line = <$fh>) { if (my $loc = ($line =~ $regex)[0]) { + # save what we found for later requests $loc_store{$sbo} = "$config{SBO_HOME}$loc"; return $loc_store{$sbo} unless wantarray; $locations{$sbo} = $loc_store{$sbo}; |