Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: Telnet Client/Server: What am I doing wrong?

by eyepopslikeamosquito (Chancellor)
on Dec 16, 2012 at 04:30 UTC ( #1009044=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Telnet Client/Server: What am I doing wrong?
in thread Telnet Client/Server: What am I doing wrong?

the previous post asked for working examples... it's difficult to cut out brief parts

Though it may be difficult, it's a good training exercise for you in learning Perl. The act of creating a small cut-down program should help you focus on and better understand the problem; you may even find you're able to identify the problem and fix it yourself.

BTW, instead of your global NS file handle and the:

select (NS); $|= 1; select (NS);
claptrap, you should use a lexical file handle ($ns say) and then simply:
use IO::Handle; # ... $ns->autoflush();
With recent Perls (5.8+), there's no need anymore to confusingly change the (global) default destination for print statements via the old evil one-argument form of select -- for more details, see Perl Best Practices, chapter 10 and Perl tip: Buffering and IO::Handle (for Perl 5.14+ you don't need use IO::Handle).

Suggest you further read Suffering from Buffering.

Comment on Re^3: Telnet Client/Server: What am I doing wrong?
Select or Download Code
Replies are listed 'Best First'.
Re^4: Telnet Client/Server: What am I doing wrong?
by PM_Visitor (Initiate) on Dec 16, 2012 at 18:12 UTC

    Thank you for the feedback and document references!
    I'm going to continue to read the Lincoln Stein Book, will check out the Best Practices book as well.
    I have read the Suffering from Buffering! A good read, indeed :).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009044]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-11-26 01:39 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (695 votes), past polls