in reply to Objectionable reference

Like NetWallah said, you're creating new lexicals which shadow existing lexicals in some of your else blocks. Fix your scoping and you'll have an easier time of debugging. Declaring lexicals at the top of your code:

my (@ports,@dests,@sources,@protos); my ($fw,$acl);

... often leads to problems.