Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by qq (Hermit)
on Mar 18, 2006 at 20:21 UTC ( [id://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

Replies are listed 'Best First'.
Re^7: top ten things every Perl hacker should know
by salva (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://537690]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-24 19:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found