Dati :: Diver.

Data :: Diver è un accesso semplice ad-hoc a elementi di strutture profondamente nidificate.
Scarica ora

Dati :: Diver. Classifica e riepilogo

Annuncio pubblicitario

  • Rating:
  • Licenza:
  • Perl Artistic License
  • Prezzo:
  • FREE
  • Nome editore:
  • Tye McQueen
  • Sito web dell'editore:
  • http://search.cpan.org/~tyemq/Data-Diver-1.0101/Diver.pm

Dati :: Diver. Tag


Dati :: Diver. Descrizione

Dati :: Diver è un accesso semplice e ad-hoc a elementi di strutture profondamente nidificate. Dati :: Diver è un accesso semplice e ad-hoc a elementi di strutture profondamente nidificate.SummaryData :: Diver fornisce le funzioni Dive () e DiveVal () per l'accesso ad-hoc a elementi di strutture dati profondamente nidificate e il divertente ( ), DiveError (), DiveClear () e Divedie () Funzioni di supporto.synopsis Uso Dati :: Diver QW (immersione Dive Divef DiveError); My $ root = {top => ,} ,},],};; # Imposta $ Value per 'Sì' # ($ root -> {top} {Secondo} {key} {tre} {esiste}): My $ Value = Dive ($ root, qw (top 1 Secondo chiave 3 tre esiste)); # Imposta $ Value per Unefd () perché "mancante" non esiste: $ Value = Dive ($ root, qw (top 1 secondo chiave 3 tre tre mancanti); # Imposta $ Value per Unefd () perché # $ root -> {top} {secondo} {key} è fuori dalla fine dell'array: $ Value = Dive ($ root, qw (top 1 secondo Key 4 ...)); # Imposta $ Valore per underf () perché # $ root -> {top} {secondo} {key} sarebbe un errore irreversibile: $ Value = Value = Dive ($ Radice, QW (Top 1 Second Key -5 ...)); # Imposta $ Ref in $ Root -> {Top} {new} {sub} (che cresce # @ {$ root-root -> {top}} e automatizza di due hashhes anonimi): My $ ref = Diverf ($ root , QW (Top 9 New Sub)); # Die () S perché "altro" non è un numero valido: $ ref = Diverf ($ root, qw (Top altro ...)); # Fa: $ root -> {num} {1} {2} = 3; # (Autoviviva gli hashes nonostante i tasti numerici.) Diveval ($ root, (qw (num 12))) = 3; # Stessa cosa: $ {diverf ($ root, 'num', 1, 2)} = 3; # Recupera il valore sopra il valore, $ Value = 3: $ Value = Diveval ($ root, 'num', 1, 2); # Stessa cosa: $ Value = $ {Diverf ($ root, (qw (num 12)))}; # Tenta di fare $ root -> {top} {1} e dies # perché $ root -> {top} è un riferimento array: Diverf ($ root, 'top', 1); # Per autovitare solo all'ultimo passaggio: $ Ref = Divef (immersione ($ root, qw (top 1 secondo 3 tre tre)), 'mancante'); se ($ ref) {$$ ref = 'me anche io'} else {my ($ nydref, $ svkey, $ errdesc) = diveerror (); Die "non poteva dereference $ nidedref tramite $$ svkey: $ errdescn"; } Requisiti: · Perl.


Dati :: Diver. Software correlato