Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^6: Pearls (not really) of Perl programming

by Courage (Parson)
on Dec 01, 2004 at 23:35 UTC ( [id://411614]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Pearls (not really) of Perl programming
in thread Pearls (not really) of Perl programming

You're right, thanks for correction.

I just could not resist to point out for general idea (I saw that in p5p list) but I forgot to recheck all details

But once we decided to be precise, let me make additional correction.
Requirement to return '-1', '0' and '+1' is too restrictive. According to perldoc -f sort:

parison order. If SUBNAME is specified, it gives the name of a subroutine that returns an integer less than, equal to, or greater than 0, depending on how the elements of the list are to be ordered. (The "<=>" and "cmp" operators are extremely useful in such routines.) SUBNAME may be a scalar variable
So any negative and positive values are ok.

Best regards,
Courage, the Cowardly Dog

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found