Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-09-01 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (6 votes), past polls