DATOS :: XHASH

ANTENDIDO, PEDIDO HASH (comúnmente conocido como una matriz asociativa o mapa) con el recorrido de la trayectoria clave y el auto ...
Descargar ahora

DATOS :: XHASH Clasificación y resumen

Anuncio publicitario

  • Rating:
  • Licencia:
  • Perl Artistic License
  • Precio:
  • FREE
  • Nombre del editor:
  • Brian Katzung
  • Sitio web del editor:
  • http://search.cpan.org/~bkatzung/

DATOS :: XHASH Etiquetas


DATOS :: XHASH Descripción

DATOS :: XHASH es un módulo PERL que proporciona una interfaz orientada a objetos a los hashes ordenados. Los elementos de hash se pueden asignar teclas explícitamente o automáticamente en las matrices de moda y coincidir como las matrices en PHP.IT también incluye soporte para árboles de XHashes, Traversal de árboles y conversión anidados de las estructuras de datos de PERL nativas. Los usos adugestados incluyen información estructurada de configuración o parámetros de consulta HTTP en los que el orden puede ser al menos a veces significativo, para pasar parámetros posicionados y nombrados mixtos, o para la porting PHP Code.Synopsis use los datos :: Xhash; Usa datos :: Xhash QW / Xhash Xhashref /; Usa datos :: xhash qw / xh xhn xhr xhrn /; $ TIEDHREF = DATOS :: XHASH-> NUEVO (); # Un hashref # un bendito y atado nota: ¡No llames "corbata"! # Las exportaciones son accesos directos para llamar a los datos :: Xhash-> Nuevo () -> PUSH () # o DATA :: XHASH-> NUEVO () -> PUSHREF () Para usted. $ TIEDHREF = XH ('Auto-indexado', {KEY => 'valor'}); $ tiedhref = xhash ('Auto-indexed', {KEY => 'valor'}); $ TIEDHREF = XHASHREF (); $ tiedhref = xhn ('hola', {raíz => {sucursal => }}); # (anidado) $ TIEDHREF = XHR (); $ tiedhref = xhrn (}}]); # (anidado) # Nota: $ Xhash significa que puede usar $ TIEDHREF o el objeto # subyacente al atado (% $ tiedhref) ## Operaciones similares a los # Teclas o rutas $ valor = $ TIEDHREF -> {$ TECLA} ; $ valor = $ tiedhref -> {\ @ ruta}; $ valor = $ xhash-> fetch ($ clave); $ valor = $ xhash-> fetch (\ @ ruta); # AUTO-VIVIFICACIÓN A DATOS :: XHASH al final de la ruta $ TIEDHREF2 = $ TIEDHREF1 -> {}; $ tiedhref -> {} -> $ some_xh_method (...); $ TIEDHREF = $ XHASH-> Fetch (); $ Xhash-> Fetch () -> $ some_xh_method (...); # Configuración de claves o rutas $ TIEDHREF -> {$ KEY} = $ valor; $ tiedhref -> {\ @ ruta} = $ valor; $ Xhash-> Tienda ($ clave, $ valor,% opciones); $ Xhash-> Tienda (\ @ ruta, $ valor,% opciones); # Configuración de la siguiente clave de índice automático $ TIEDHREF -> {[]} = $ valor; # Sintaxis recomendada $ TIEDHREF -> {+ UNDEF} = $ Valor; $ TIEDHREF -> {} = $ valor; # Cualquier clave de ruta puede ser UNDEF $ XHASH-> Tienda ([], $ valor,% opciones); $ Xhash-> Tienda (UNDEF, $ Valor,% Opciones); $ Xhash-> Tienda (, $ valor,% opciones); # Borrar el Xhash% $ TEDEDHREF = (); $ xhash-> claro (); # Eliminar una tecla y obtener su valor $ valor = eliminar $ tiedhref -> {$ key}; # o \ @Path $ Valor = $ Xhash-> Eliminar (Tecla $); # o \ @path # existe una clave? $ boolean = existe $ tiedhref -> {$ key}; # o @ @path $ boolean = $ xhash-> existe ($ clave); # o \ @Path # Llaves y listas de llaves @Keys = Teclas% $ TIEDHREF; # Todas las llaves; Restablece el ITERATOR @Keys = $ Xhash-> Teclas (% Opciones); $ KEY = $ XHASH-> FIRST_KEY (); $ KEY2 = $ XHASH-> NEXT_KEY ($ KEY1); $ KEY = $ XHASH-> Last_Key (); $ KEY = $ XHASH-> Siguiente_index (); # La siguiente tecla de índice automático # valora @all_values ​​= valores% $ tiedhref; @some_values ​​= @ {% $ tiedhref} {@ keys}; # o pathrefs @all_values ​​= $ xhash-> valores (); @Some_Values ​​= $ Xhash-> Valores (\ @ Teclas); # o pathrefs ($ clave, $ valor) = cada uno (% $ tiedhref); # Tecla / Valor iteración # ¿El hash contiene alguna llave / pareja de valor? $ booleano = escalar (% $ tiedhref); $ booleano = $ xhash-> escalar (); ## Operaciones similares a la matriz $ valor = $ xhash-> pop (); # Último valor (clave clave, $ valor) = $ Xhash-> Pop (); # Última tecla / valor $ valor = $ Xhash-> Shift (); # Primer valor ($ clave, $ valor) = $ xhash-> Shift (); # primera clave / valor # agrega valores o {teclas => valores} $ xhash-> PUSH (@Ellements); $ XHASH-> PUSHREF (\ @ elementos,% Opciones); # Insertar valores o {teclas => valores} $ xhash-> sin navegación (@Ellements); $ XHASH-> UNSHIFTREF (\ @ elementos,% Opciones); # Exportar en forma de matriz de moda @list = $ xhash-> as_array (% opciones); $ LISTA = $ XHASH-> As_arrayref (% Opciones); # Exportar en Fasion Fasion @ list = $ Xhash-> AS_HASH (% Opciones); $ LISTA = $ XHASH-> AS_HASHREF (% Opciones); # Reordenar elementos $ XHash-> Reordenar ($ Referencia, @Keys); # [] = ordenado index_only # remapa elementos $ xhash-> reembols (% mapeo); # o \% Mapeo $ Xhash-> Renumerar (% opciones); ## Métodos de Tiehash - Ver Perltie # Tiehash, Fetch, Tienda, Clear, FirstKey, página de inicio de PRODUCTO


DATOS :: XHASH Software relacionado