Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Code Interpretation

by Athanasius (Archbishop)
on Jul 28, 2014 at 15:53 UTC ( [id://1095382]=note: print w/replies, xml ) Need Help??


in reply to Code Interpretation

Hello Perl_Ally, and welcome to the Monastery!

muba has answered your question; I’ll just add a couple of comments:

  1. The syntax sort { $a <=> $b } does sort numerically, but in ascending order. To get descending order, you reverse $a and $b: sort { $b <=> $a }.

  2. The syntax @array[...] is called an array slice. See perldata#Slices.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Code Interpretation
by Perl_Ally (Novice) on Jul 28, 2014 at 15:56 UTC

    Thanks so much for the clarification!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-04-18 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found