🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #13539

Una de PERL.

#13539
From: Juan Salvador
Date: Fri, 16 Feb 2001 12:47
29 lines
1722 bytes
Hola a todos.

He estado investigando sobre el funcionamiento de la funcion sort en perl y 
no veo claro como puedo ordenar un array de hashes. El codigo que genera el 
array es algo asi:

my @mimatriz = ();

bucle1 { # Por abreviar ...
  my %registro;

  $registro{cod} = ObtenerCodigo;
  $registro{datos} = ObtenerDatos;

   push(@mimatriz, \%registro);
}

�Como puedo ordenar @mimatriz por cod ($mimatriz[$indice]{cod}) mediante la 
funcion sort?. �Alguien lo sabe?

Muchas gracias a todos por anticipado.
-- 
-----------------------------
Juan Salvador Perez Garcia
salvaperez@wanadoo.es
Usuario Registrado: 139516
En Casa: RH 6.2 + Kernel 2.2.18 + Ximian GNome 1.2
En Trabajo: MDK 7.2 + Kernel 2.4.1 + KDE 2.0.1
-----------------------------
Technical Details
Message-ID: <96j7ht$itn$1@m2wpersoisp01.wanadoo.es>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!193.251.151.101!opentransit.net!newsfeed.comtenidos.com!m2newsfeeder01!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,dff003dcc58d9ee5,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-02-16 05:02:21 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!193.251.151.101!opentransit.net!newsfeed.comtenidos.com!m2newsfeeder01!not-for-mail
From: Juan Salvador <salva.perez@ctv-jet.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Una de PERL.
Date: Fri, 16 Feb 2001 13:47:27 +0100
Organization: Wanadoo
Lines: 30
Message-ID: <96j7ht$itn$1@m2wpersoisp01.wanadoo.es>
Reply-To: jperez@es.wanadoo.com
NNTP-Posting-Host: nat.ctv.es
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8Bit
X-Trace: m2wpersoisp01.wanadoo.es 982327677 19383 212.25.128.2 (16 Feb 2001 12:47:57 GMT)
X-Complaints-To: usenet@m2wpersoisp01.wanadoo.es
NNTP-Posting-Date: Fri, 16 Feb 2001 12:47:57 +0000 (UTC)
User-Agent: KNode/0.3.3