![]() The *glob notation is something of a symbolic reference. Symbolic references are names of variables or other objects, just as a symbolic link in a Unix filesystem contains merely the name of a file. (In a sense, everything in Perl is an object, but we usually reserve the word for references to objects that have been officially "blessed" into a class package.) (Reference counts for values in self-referential or cyclic data structures may not go to zero without a little help see "Circular References" for a detailed explanation.) If that thing happens to be an object, the object is destructed. Hard references are smart-they keep track of reference counts for you, automatically freeing the thing referred to when its reference count goes to zero. Because arrays and hashes contain scalars, you can now easily build arrays of arrays, arrays of hashes, hashes of arrays, arrays of hashes of functions, and so on. Perl now not only makes it easier to use symbolic references to variables, but also lets you have "hard" references to any piece of data or code. #DESCRIPTIONÄ«efore release 5 of Perl it was difficult to represent complex data structures, because all references had to be symbolic-and even then it was difficult to refer to a variable instead of a symbol table entry. For a shorter, tutorial introduction to just the essential features, see perlreftut. This is complete documentation about all aspects of references. Perlref - Perl references and nested data structures #NOTE WARNING: Don't use references as hash keys.Pseudo-hashes: Using an array as a hash. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |