Im very new to perl so still learning.

My aim is to have a script which checks a server for a flag to change and when it finds the change fire off a script I have in php.
The server is on a phone switch so I query a chanel and it give a responce eg:

I say ch1 it then says

ch1, Y, 01:23, 4402, 01xxxxxxxxx
(which is the chanel, flag, call duration, extension which has siezed the chanel and the destination)

or free
ch1, N

So the script I have so far is:

#! /usr/bin/perl -w
use IO::Socket;
use strict;

my($remote_host, $remote_port, $response, $socket);

#Server details
$remote_host = "";
$remote_port = 343;

print "IPO Checker\nConnecting\n";

$socket = IO::Socket::INET->new(PeerAddr => $remote_host,
                                PeerPort => $remote_port,
                                Proto    => "tcp",
                                Type     => SOCK_STREAM)
    or die "Couldn't connect to $remote_host:$remote_port : $@\n";

print "Checking:\n";

    print $socket "ch1";
    $response = <$socket>;
    print $response;

# and terminate the connection when we're done
print "Done!";
Ultimately I will loop the check etc but first I would like to get a single check working (baby steps here )
The above I have hacked around from various tutorials and the bit im struggling with is sending and recieving the responce from the server.