Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How can I access object data in a user defined sort cmp function?

by Anonymous Monk
on Jan 28, 2015 at 14:34 UTC ( #1114753=note: print w/replies, xml ) Need Help??


in reply to How can I access object data in a user defined sort cmp function?

(I came to the conclusion Guido was right about whitespace)

using global... I mean, local our variables. Just like $a and $b.
use strict; use warnings; sub sort_aux { our $self; $a <=> $b; } sub hash_ref_keys_by_value { local our $self = shift; my @keys = sort by_value keys %{ $self->{hash_ref} }; }
  • Comment on Re: How can I access object data in a user defined sort cmp function?
  • Download Code

Replies are listed 'Best First'.
Re^2: How can I access object data in a user defined sort cmp function?
by Laurent_R (Canon) on Jan 28, 2015 at 18:58 UTC
    (I came to the conclusion Guido was right about whitespace)
    Hilarious! ++

    Je suis Charlie.
      just if hacked directly and uncompiled like in this case, Python would be a muuuuuuuuuch bigger mess.

      Cheers Rolf

      PS: Je suis Charlie!

Re^2: How can I access object data in a user defined sort cmp function?
by sundialsvc4 (Abbot) on Jan 28, 2015 at 22:59 UTC
    [deleted: got attached to the wrong reply!!]

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2022-01-21 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (59 votes). Check out past polls.

    Notices?