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:


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.


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


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


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


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

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 © 2008-2017.
If you may any questions please contact us: