First, a simple question: Is the following a version string? If not, what's it called?
%perl -le'print 127.0.0.1' | cat -v ^?^@^@^A
What's the expected behavior with negation? I think negation should be meaningless because this is really a string not a number, right? Specifically, can someone explain these results (via Apple's Perl 5.8.6):
% perl -le'print 64.0.0.1' | cat -v @^@^@^A % perl -le'print 65.0.0.1' | cat -v A^@^@^A % perl -le'print -64.0.0.1' | cat -v 0 % perl -le'print -65.0.0.1' | cat -v -A^@^@^A
The first two are expected. The third one is baffling. The fourth appears to be treating the "65.0.0.1" as a string. In that sense, it resembles:
% perl -le'print -"aaa"' | cat -v -aaa
In the "-64.0.0.1" case, the "64" is not special. Any number below 65 seems to trigger that result. Deparse doesn't really help explain anything either, except that Deparse is confused by the minus signs too:
% perl -MO=Deparse -e'print 65.0.0.1' print 65.0.0.1; % perl -MO=Deparse -e'print 64.0.0.1' print 64.0.0.1; % perl -MO=Deparse -e'print -65.0.0.1' print "-A\000\000\cA"; % perl -MO=Deparse -e'print -64.0.0.1' print 0;

In reply to version string oddities by chrisdolan

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.