Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # RoutesRef is a hash with keys such as "1.1.1 1.1.2 1.1.3 ..."
- sub validate {
- my ($Self, $RoutesRef) = @_;
- use Sort::Versions;
- my %Routes = %$RoutesRef;
- my @RemRoutes = keys %Routes; #remaining routes
- @RemRoutes = sort {versioncmp $a, $b} @RemRoutes;
- print "remroutes: @RemRoutes\n";
- # main loop
- while (1) {
- # if there is no route left to test
- if (!@RemRoutes) {
- $Self->pd(" No routes remaining - ending test.", 2);
- return $Stat;
- }
- # go through every single route and pick the routes to test this round
- foreach my $Route (@RemRoutes) {
- print "looking at route:$Route\n";
- shift @RemRoutes;
- }
- }
- }
Add Comment
Please, Sign In to add comment