Here are several different ways to test a TCP port without telnet.
bash (man page)
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
bash: connect: Connection refused
bash: /dev/tcp/127.0.0.1/23: Connection refused
$ curl -v telnet://127.0.0.1:22
* About to connect() to 127.0.0.1 port 22 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 22 (#0)
SSH-2.0-OpenSSH_5.3
^C
$ curl -v telnet://127.0.0.1:23
* About to connect() to 127.0.0.1 port 23 (#0)
* Trying 127.0.0.1... Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
python -c 'import socket; socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect(("127.0.0.1", 22))'
perl -MIO::Socket::INET \
-e 'new IO::Socket::INET(PeerHost => $host, PeerPort => $port, Proto => $proto) or die "Cannot connect: $!\n"' \
-s -- \
-proto=tcp \
-host=localhost \
-port=22