Based on your snippet (as correctly pointed out in an earlier reply), it looks like line-termination characters have nothing at all to do with your problem (I don't understand why other replies have been dwelling on this I'm guessing the first two replies were thrown off by your reference to "line endings" -- d'oh!).

To figure out what is going on, you might try something like this on your various linux boxes:

./some_executable.out -f some_param | od -txC -a
(Look up the man page for "od" to see if other options might make its output more useful to you.)

Is the executable copied as a binary file from one linux box to the other, or is it compiled from source code on each box? If the latter, is it compiled with the same configuration each time, or do things like libraries, locale, etc, differ from one box to the next?

Whatever it is, that executable is printing one or more lines of output, your script is reading each line as an array element, you are removing the line-feed from each line, and then assigning the first two space-separated tokens on the line to $tm and $val.

And you're finding some goofy character at the end of that first token ($tm), which you'd like to remove, no matter what it may be;  chop $tm should work fine for that (as pointed out by virtualsue above).

But you'll want to look at it carefully, in detail. If the executable is returning some sort of multi-byte wide character, you might need something like "od" to see all the bytes. Come back with more detail if you get stumped, but hopefully, "od" will make things clearer for you.

(Updated to clarify that I wasn't implying any misunderstanding on virtualsue's part.)


In reply to Re: Regex for replacing hidden character: « and L by graff
in thread Regex for replacing hidden character: « and L by neversaint

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.