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 127.0.0.1' | cat -v ^?^@^@^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 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
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 -le'print -"aaa"' | cat -v -aaa
% 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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |