Notation


In this book I use my "PEGS" ( PErl Graphical Structures) notation to illustrate data structures. It should be mostly self-explanatory, but here is a brief overview.

Scalar values are represented with a single rectangular box:

graphics/01fig01.gif

Variables are values with names. Names go in a sideways "picket" above the value. Boxes can be adorned with the internal Perl type [3] and with the access syntax for the value:

[3] For example, GV or SV . If you don't know what these mean, you probably don't need to worry about them.

graphics/01fig02.gif

Arrays and lists have the same graphical representation. They look like a stack of values with a thick bar on top:

graphics/01fig03.gif

Hashes look like a stack of names next to a stack of values:

graphics/01fig04.gif

References are drawn with dots and arrows like those LISP diagrams from days of yore:

graphics/01fig05.gif

That's all there is to the basics. PEGS is really not very complicated, but if you want to know more, you can take a look at the official PEGS web page, located at http://www.effectiveperl.com/pegs/.



Effective Perl Programming. Writing Better Programs with Perl
Effective Perl Programming: Writing Better Programs with Perl
ISBN: 0201419750
EAN: 2147483647
Year: 1996
Pages: 116

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net