For a more complete discussion on Perl Value Types see Advanced Perl Programming, but to prarphrase from page 329 of my copy
A scalar value (SV - arrays are AV, hashs are HV etc) will be made up internally of its current value, a count of the number of references to that scalar, and an internal bitmask that decribes the current 'type' or 'state' of the value. These types can be
So what you need, to get away from
0|value1|value2
cruft is to force the scalar from type PV to IV

and _my_ favorite way to do this is
$value += 0;
this also my favorite way to trim leading zeroes from digit 'strings' - better than some regex's I've seen


In reply to Re: Bug in perl bitwise or?? by leriksen
in thread Bug in perl bitwise or?? by Anonymous Monk

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.