#!/usr/bin/perl -w use IO::Socket; $rsock = new IO::Socket::INET (PeerAddr => 'blah', PeerPort=> 1234, Proto => 'tcp', ); die "Remote socket could not be created: $!\n" unless $rsock; $str[0]="\002"; $str[1] = unpack("B*", pack("N", 47)); $str[2] = unpack("B*", pack("N", 12)); $str[3] = unpack("B*", pack("N",76)); $str[4] = unpack("B*", pack("N", 1)); $str[5] = unpack("B*", pack("N", 0)); $str[6] = unpack("B*", pack("N", 1)); $header=join('',@str); $header=$header."LOGON USERNAME=NAME PASSWORD=PASS\0"; print $rsock $header; #syswrite($rsock,$header,47); # Print, or syswrite? Neither seem to help... while (<$rsock>) { last unless /\S/; chomp; print; } # Returns Error: Ileagle message size in header