in reply to Re: Re: Problem in IO::Socket syntax?
in thread Problem in IO::Socket syntax?

If i understand correctly (and I havent run your code) you should be using the variable $service in your hash, rather than the hard reference service.

Your hash %ports has no key of service.