Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Unknown charactersby HyperDevil (Initiate) |
on Feb 08, 2011 at 22:17 UTC ( [id://887070]=perlquestion: print w/replies, xml ) | Need Help?? |
HyperDevil has asked for the wisdom of the Perl Monks concerning the following question:
I am programming an AIVDM parser in Perl. It receives data using UDP (recv), the mechanism seems to work fine. But the issue is that there are some unknown characters in the message which perl puts into the scalar variable which i cannot seem to get rid of. I have tried to chomp the scalar which removes the text completely, but length() still reports correctly. A regex which deletes all hex values which are not numbers or letters, with no effect. Converted the scalar to hex and back into a another scalar, the new scalar has the same issue. Code: Output is: The first line is ok! Did you see the second line, where does the space come from? There is also no newline character in the $msg. Code: Now without the \n i get this: Now the second message i receive make a new line without me specifieng a \n. I have been trying to remove these weird characters for days without avail, so i need some help from the experts :) Update: Does also not give any output at all!
Back to
Seekers of Perl Wisdom
|
|