![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re^7: Split any number into string of 8-bit hex values (=1 byte) (updated)by AnomalousMonk (Bishop) |
on Aug 30, 2021 at 22:00 UTC ( #11136256=note: print w/replies, xml ) | Need Help?? |
Further to tybalt89's comment: ... your regex works ... works great for unsigned numbers ... I assume you mean signed numbers in the second case; if so, please supply representative test cases: just what output do you expect for -255, -256, -65535, -65536, etc.
And I would strongly suggest concentrating on edge cases in your test cases, e.g. something like Update: Also, are you aware that the sprintf 'x' format conversion is essentially unsigned:
Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|