in reply to Re^2: Usage of IO::Socket::PortState

I suspect your port from the file includes a newline character and thus the check is failing.