Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
There's more than one way to do things
 
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 romping around the Monastery: (6)
As of 2014-04-17 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (437 votes), past polls