[Israel.pm] how to sorting the hash elements dynamically
Tal Kelrich
tal at musicgenome.com
Wed Jul 19 09:58:21 EEST 2006
On Tue, 18 Jul 2006 22:19:59 -0700 (PDT)
rami doqa <rod082 at yahoo.com> wrote:
> I am interesting in how can I do a dynamic sorting for
> the hash elements. ex:
>
> if (# something...)
> {
> $syntax = "{$result->[1]{$a}[3] <=>
> $result->[1]{$b}[3]}"; # ASC
> }
Shouldn't that be an anonymous subroutine?
$syntax = sub { $result->[1]{$a}[3] <=> $result->[1]{$b}[3]} ; #ASC
--
Tal Kelrich
PGP fingerprint: 3EDF FCC5 60BB 4729 AB2F CAE6 FEC1 9AAC 12B9 AA69
Key Available at: http://www.hasturkun.com/pub.txt
----
And ever has it been known that love knows not its own depth until the
hour of separation. -- Kahlil Gibran ----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://perl.org.il/pipermail/perl/attachments/20060719/80349c9a/attachment.pgp
More information about the Perl
mailing list