HyperDevil has asked for the wisdom of the Perl Monks concerning the following question:
Output is:while ($sock->recv($msg, 1024)) { $length = length($msg); print "MESSAGE: $msg LENGTH: $length\n"; }
The first line is ok!MESSAGE: !A LENGTH: 2 MESSAGE: IVDM,1,1,,A,?3nGtL0uPi7pD00,2*46 LENGTH: 34
Now without the \n i get this:while ($sock->recv($msg, 1024)) { $length = length($msg); print "MESSAGE: $msg LENGTH: $length"; }
Now the second message i receive make a new line without me specifieng a \n.MESSAGE: !AI LENGTH: 3MESSAGE: ADM,1,1,,A,13mK@M0P000gVvvTC=4:LgwV2L0B +,0*4C LENGTH: 46MESSAGE: !AIVDM,1,1,,A,40 LENGTH: 16MESSAGE: 2M43AudTF;o0fr +sPTBHl700L0h,0*5A
Does also not give any output at all!while ($sock->recv($msg, 1024)) { $msg1 = substr $msg, 0, -1; print "MESSAGE: $msg1 LENGTH: $length"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Unknown characters
by mvaline (Friar) on Feb 08, 2011 at 23:58 UTC | |
Re: Unknown characters
by umasuresh (Hermit) on Feb 08, 2011 at 22:21 UTC | |
by HyperDevil (Initiate) on Feb 08, 2011 at 22:25 UTC | |
by Crackers2 (Parson) on Feb 08, 2011 at 22:37 UTC | |
by HyperDevil (Initiate) on Feb 08, 2011 at 23:07 UTC | |
Re: Unknown characters
by rowdog (Curate) on Feb 10, 2011 at 05:43 UTC |