in reply to Comparing two variables from different loops

Your description sounds like you might want to build up a hash in the first while loop, with keys being $origin_service. Then you could check in the second loop whether a $destination_service is found among the origin services... (exists $services{$destination_service}).

BTW, it seems to me you've got a few typos in your code (e.g. $dest_service vs. $destination_service) — I could be wrong though...   Anyway, using strictures might help with that.