many - A simple script to demonstrate a one-to-many association (/examples).
1.00
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.
perldoc Polygon.pm perldoc Point.pm
Name: Michael Schlueter
email: mschlue@cpan.org
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.
To install Class::Classgen::New, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Classgen::New
CPAN shell
perl -MCPAN -e shell install Class::Classgen::New
For more information on module installation, please visit the detailed CPAN module installation guide.