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} }; }
|
---|
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 | |
by LanX (Saint) on Jan 28, 2015 at 19:11 UTC | |
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 |
In Section
Seekers of Perl Wisdom