Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
##Object: sub _byCode { $a->asStringFmt() cmp $b->asStringFmt; } my $callback = $self->{sortCallback} || "_byCode"; ... foreach my $key (sort $callback @{$myList->getKeys}) { ... }
##Client: my $byCodeAndX = sub { .... }; my $obj = new Obj( sortCallback => $byCodeAndX )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: providing a callback routine to sort ( $::a $::b )
by Anonymous Monk on Jan 21, 2014 at 21:53 UTC | |
|
Re: providing a callback routine to sort
by pemungkah (Priest) on Jan 21, 2014 at 22:04 UTC | |
by Anonymous Monk on Jan 21, 2014 at 22:41 UTC | |
by pemungkah (Priest) on Jan 23, 2014 at 03:29 UTC | |
|
Re: providing a callback routine to sort
by Anonymous Monk on Jan 21, 2014 at 23:01 UTC | |
|
Re: providing a callback routine to sort
by Laurent_R (Canon) on Jan 21, 2014 at 23:26 UTC | |
by Anonymous Monk on Jan 22, 2014 at 04:17 UTC | |
by Anonymous Monk on Jan 22, 2014 at 14:24 UTC |