Hi monks,

I want to msn my buddy under windows command prompt by MSN module. Below is part of my script.
my $run = 1; while( $run ) { $msn->do_one_loop(); } # do_one_loop is in MSN.pm sub do_one_loop { my $self = shift; # return immediately if we are not connected return if( !$self->{Connected} ); $self->{Notification}->ping( ); foreach my $convo (values %{$self->getConvoList()}) { $convo->p2pSendOne() if $convo->p2pWaiting; } my @ready = $self->{Select}->can_read(.1); foreach my $fh ( @ready ) { # get the filenumber for this filehandle my $fn = $fh->fileno; # get the object assocatied with this filenumber my $connection = $self->{Connections}->{$fn}; # DO WE NEED THIS CODE? if the connection is really dead, will + it even be showing up in the list of filehandles that can be read fr +om?? # if the connection is dead, remove it from the select, delete + it from the Connections list and output a warn if( !$connection->{Socket}->connected() ) { $self->{Select}->remove( $fn ); delete( $self->{Connections}->{fn} ); warn "Killing dead socket"; next; } sysread( $fh, $connection->{buf}, 2048, length( $connection->{ +buf} || '' ) ); while( $connection->{buf} =~ s/^(.*?\n)// ) { $connection->{line}= $1; my $incomingdata = $connection->{line}; $incomingdata =~ s/[\r\n]//g; print( "($fn $connection->{Type}) RX: $incomingdata\n" ) i +f( $self->{ShowRX} ); my $result = $connection->dispatch( $incomingdata ); last if( $result && $result eq "wait" ); } } }
The scirpt can connect to server successfully. But I can't input any command to CLI window(no operate,no echo). In fact, The command I input echo to CLI until I quit the script. I suspect that it related to Windows, but I can't be sure.
I hope I describe my question clearly enough. Thanks in advance!

I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

In reply to Can't use MSN by xiaoyafeng

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.