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
- IV(integer value)
- NV(numeric or double)
- PV(string or pointer value)
- RV(reference)
- PV(A|H|C|G)V is for array|hash|code|glob
- PVMG for magic (blessed) references
So what you need, to get away from
0|value1|value2cruft 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