in reply to NEXT statement in for loop

Since you don't define @routers and don't use the $rh loop variable, it would seem that this:
for my $rh (@routers) { my $r = shift(@router); # ...
could probably be rewritten more clearly this way:
for my $r (@router) { # ...
But it depends on whether you plan to use the @router somewhere else in your code.

Update: s/;/{/;. Thanks to Athanasius for pointing out a copy/paste error.