Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: A philosophical pondering concerning hexesby ysth (Canon) |
on Jun 23, 2004 at 08:28 UTC ( [id://368972]=note: print w/replies, xml ) | Need Help?? |
Your description of dec() is what oct() does, except for the "Assume decimal" line, which is pretty useless in perl.
At least it isn't named something horrid like strtoul. Oh, and you've got reverse "backward". You pass it a reversed string and it returns a string in the correct order, so it is analogous to oct() after all :) Update: oops; I missed the ? in (0x)?; oct() requires the 0x to be there. Sounds like what you ought to do is implement sscanf in POSIX.pm and use it instead of oct/hex.
In Section
Meditations
|
|