in reply to Re^2: String increment - reasoning
in thread String increment - reasoning

*shrug* if you don't want perl to dwim, be explicit, as always. For number operations, there's the rule "it's a number as long as it looks like a number (from left to right)".

Incrementig 31-OCT-2007-RevA what should perl do? 31-OCT-2007-RevB, 32-OCT-2007-RevA or 1-NOV-2007-RevA ? The latter with or without leading zero? How could that decision be reliably coded?

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^4: String increment - reasoning
by eric256 (Parson) on Oct 03, 2007 at 23:39 UTC

    That made me pictures a DWIM::Inc module. ;)


    ___________
    Eric Hodges