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

Re: What I Most Recently Learned in Perl, But Should Have Already Known

by jplindstrom (Monsignor)
on Aug 17, 2006 at 08:34 UTC ( #567852=note: print w/ replies, xml ) Need Help??


in reply to What I Most Recently Learned in Perl, But Should Have Already Known

One thing that bit me a few months ago: sort in scalar context is undefined.

That isn't a big deal until you do this in a sub:

return( sort @some_array );

that is supposed to return a sorted list. And then you wonder how many elements the list contains:

my $count = get_the_sorted_list(); #Scalar context propagates to sort

That's pretty annoying when you happen to do it, and pretty important to know about so you don't. I sure was surprised the first time I encountered it.

/J


Comment on Re: What I Most Recently Learned in Perl, But Should Have Already Known
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-10-22 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls