Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^6: top ten things every Perl hacker should know

by qq (Hermit)
on Mar 18, 2006 at 20:21 UTC ( #537690=note: print w/ replies, xml ) Need Help??


in reply to Re^5: top ten things every Perl hacker should know
in thread top ten things every Perl hacker should know

We sort of have a sort_by method in Sort::Maker. But I've never liked the api. There is no denying that an ST is a scary sight to a new programmer not familiar with the idiom. I'd argue it should be wrapped in a sub for clarity most often.

I like the PBP argument for using List::Util and List::MoreUtils functions such as any rather than idiomatic uses of grep. It makes your intention clear, and prevents you from thinking in syntax - no matter how comfortable and familiar that syntax is.

update: added some words for clarity


Comment on Re^6: top ten things every Perl hacker should know
Select or Download Code
Re^7: top ten things every Perl hacker should know
by salva (Abbot) on Mar 20, 2006 at 15:55 UTC
    We sort of have a sort_by method in Sort::Maker. But I've never liked the api

    you should try Sort::Key, it has a very simple API and it's faster and uses less memory than any other perl sorting technique:

    use Sort::Key qw(keysort); my @sorted = keysort { genkey($_) } @data;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2014-12-22 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (128 votes), past polls