Guest User

Untitled

a guest
Jun 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1.  
  2. # RoutesRef is a hash with keys such as "1.1.1 1.1.2 1.1.3 ..."
  3.  
  4. sub validate {
  5. my ($Self, $RoutesRef) = @_;
  6. use Sort::Versions;
  7. my %Routes = %$RoutesRef;
  8.  
  9. my @RemRoutes = keys %Routes; #remaining routes
  10. @RemRoutes = sort {versioncmp $a, $b} @RemRoutes;
  11. print "remroutes: @RemRoutes\n";
  12.  
  13.  
  14. # main loop
  15. while (1) {
  16.  
  17. # if there is no route left to test
  18. if (!@RemRoutes) {
  19. $Self->pd(" No routes remaining - ending test.", 2);
  20. return $Stat;
  21. }
  22.  
  23. # go through every single route and pick the routes to test this round
  24. foreach my $Route (@RemRoutes) {
  25. print "looking at route:$Route\n";
  26.  
  27. shift @RemRoutes;
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment