Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Simpler Section Numbers

by chip (Curate)
on Jul 28, 2000 at 22:34 UTC ( #24963=note: print w/ replies, xml ) Need Help??

in reply to RE: RE: Re: Sorting on Section Numbers
in thread Sorting on Section Numbers

You simplified it a lot by dropping $maxdigs.

It's a fair cop, but society's to blame.

I appreciate your final no-hash sprintf approach, but modifying temp values in a grep gives me the screaming heebie-jeebies, you know what I mean? I'd much rather use map for that sort of thing. But I can't argue with the fact that it works.... And my Rule #0 is, ``Anything that works is better than anything that doesn't.''

    -- Chip Salzenberg, Free-Floating Agent of Chaos

PS: Thanks for the welcome. This is a neat site.

Comment on Simpler Section Numbers
Select or Download Code
RE: Simpler Section Numbers
by tye (Cardinal) on Jul 28, 2000 at 23:32 UTC

    Actually I wrote it as map first and, of course, it didn't work because s// doesn't return the modified string. Breaking the unwritten rule of grep seemed slicker than:

    map {s/.../.../ge; $_}
    which still hides side-effects inside map or:
    map {(my $x= $_)=~s/.../.../ge; $x}
    which just, well, isn't slick. :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://24963]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-12-20 21:32 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (99 votes), past polls