The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

many - A simple script to demonstrate a one-to-many association (/examples).

VERSION

1.00

SYNOPSIS

DESCRIPTION

many creates two Polygons (Polygon-instances to be exact) and allows some manipulations back and forth the association.

The Poygon-to-Point direction is associated via the internal Polygon::@points list. The Point-to-Polygon direction is explicitely associated in the Polygon->add() function.

Within the debugger you may find:

        main::(many:20):        $POL->add(210, 310);
          DB<2> 
        main::(many:24):        print "pol consists of ". $pol->get_N() . " points\n";
          DB<2> 
        pol consists of 4 points
        main::(many:25):        print "POL consists of ". $POL->get_N() . " points\n";
          DB<2> x $POL
        0  Polygon=HASH(0x8223c0c)
           '_a_has' => undef
           '_l_points' => ARRAY(0x8221110)
              0  Point=HASH(0x8223bc4)
                 '_a_belongs_to' => Polygon=HASH(0x8223c0c)
                    -> REUSED_ADDRESS
                 '_x' => 100
                 '_y' => 250
              1  Point=HASH(0x8223b40)
                 '_a_belongs_to' => Polygon=HASH(0x8223c0c)
                    -> REUSED_ADDRESS
                 '_x' => 210
                 '_y' => 310

which is ok.

ENVIRONMENT

DIAGNOSTICS

BUGS

FILES

SEE ALSO

        perldoc Polygon.pm
        perldoc Point.pm

AUTHOR

Name: Michael Schlueter

email: mschlue@cpan.org

COPYRIGHT

Copyright (c) 2000, Michael Schlueter. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.