in reply to CHOMP VS. CHOP

Are you connecting to a Unix server from a windoze client? Domestos has a two characters at the end of a line. A line feed and a carriage return. Unix has just the line feed. I wrote a win32/unix client server app recently and didn't have any problems with the conversion. I wouldn't use a chop instead of chomp here but I doubt the carriage return is a random event. I've tried to re-create the problem with the following code on NT and Solaris but I'm afraid it works fine for me?

Server code on a unix box
#!/usr/local/bin/perl use IO::Socket; print "Waiting...\n"; $socket = IO::Socket::INET->new(LocalPort => 4321, Proto => 'udp'); $socket->recv($text,128); chomp $text; print "Got this message: >${text}<\n"; close $socket;


And the client
#!/usr/local/bin/perl use IO::Socket; $x="my string ends here\n"; $sock = new IO::Socket::INET( PeerAddr => 'machine_name', PeerPort => 4321, Proto => 'udp'); $sock->send($x);


Produces;
Got this message: >my string ends here<

In my experience some ftp/udp/tcp clients leave the ^M on and some don't. If you have it check out Russ's node Removing ^M