Fix subtle Perl issue
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 21 Aug 2012 18:36:32 +0000 (14:36 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 21 Sep 2012 15:06:58 +0000 (11:06 -0400)
Not a syntax error that the compiler will catch, but see
"perldoc -f do" which will lead you do "perldoc perlsyn"

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/URLVerify.pm

index ecac93f..d794238 100644 (file)
@@ -681,7 +681,8 @@ sub _get_all_search_results {
         my $count;
         my $so_far = 0;
 
-        do {
+        LOOP: { do {    # Fun fact: you cannot "last" out of a do/while in Perl
+                        # unless you wrap it another loop structure.
             my $search = $session->search . " offset(".scalar(@result_ids).")";
 
             my $res = $U->simplereq(
@@ -707,7 +708,7 @@ sub _get_all_search_results {
             last unless @this_batch; # Protect against getting fewer results
                                      # than count promised.
 
-        } while ($count - scalar(@result_ids) > 0);
+        } while ($count - scalar(@result_ids) > 0); }
     }
 
     return (undef, @result_ids);