Global Information Lookup Global Information

Autovivification information


In the Perl programming language, autovivification is the automatic creation of new arrays and hashes as required every time an undefined value is dereferenced. Perl autovivification allows a programmer to refer to a structured variable, and arbitrary sub-elements of that structured variable, without expressly declaring the existence of the variable and its complete structure beforehand.[1]

In contrast, other programming languages either: 1) require a programmer to expressly declare an entire variable structure before using or referring to any part of it; or 2) require a programmer to declare a part of a variable structure before referring to any part of it; or 3) create an assignment to a part of a variable before referring, assigning to or composing an expression that refers to any part of it.

Perl autovivification can be contrasted against languages such as Python, PHP, Ruby, and many of the C style languages, where dereferencing null or undefined values is not generally permitted.[a] It can be compared to the HTML standard's "named access on the window object"[2] which results in corresponding globally scoped variables being automatically accessible to browser-based JavaScript.

  1. ^ Schwartz, Randal L.; Phoenix, Tom (2003). Learning Perl Objects. O'Reilly Media, Inc. p. 42. ISBN 9780596004781. This process is called autovivification. Any nonexisting variable, or a variable containing undef, which is dereferenced while looking for a variable location (technically called an lvalue context), is automatically stuffed with the appropriate reference to an empty item...
  2. ^ "HTML Standard. Named access on the Window object".


Cite error: There are <ref group=lower-alpha> tags or {{efn}} templates on this page, but the references will not show without a {{reflist|group=lower-alpha}} template or {{notelist}} template (see the help page).

and 1 Related for: Autovivification information

Request time (Page generated in 0.5423 seconds.)

Autovivification

Last Update:

autovivification is the automatic creation of new arrays and hashes as required every time an undefined value is dereferenced. Perl autovivification allows...

Word Count : 1375

PDF Search Engine © AllGlobal.net