in reply to Re^3: Socket Listener
in thread Socket Listener

If anyone is still watching, this seems to get me started. I couldn't get the POE to work for me.
use IO::Socket; my $sock = new IO::Socket::INET ( LocalHost => 'nonsvch', LocalPort => '6543', Proto => 'tcp', Listen => 1, Reuse => 1, ); die "Could not create socket: $!\n" unless $sock; my $new_sock = $sock->accept(); while(<$new_sock>) { print $_; } close($sock);
It works ok if I telnet to it, type and hit return, but my feed has no CRLF, it does however have end of record strings
=*=
so how do I make it read without blocking for CRLF ? Thanks

Replies are listed 'Best First'.
Re^5: Socket Listener
by BrowserUk (Patriarch) on Mar 31, 2010 at 21:49 UTC

    Try using recv instead of the diamond operator.

    Update: Or setting $/ = '=*=';


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.