in reply to Re^2: returning values from a sub
in thread returning values from a sub

Then you'll want getservbyport.