Class::PrototypedClass::Prototyped is a fast prototype-based OO programming in Perl. | |
Download |
Class::Prototyped Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Ned Konz and Toby Ovod-Everett
- Publisher web site:
- http://search.cpan.org/~teverett/Class-Prototyped-1.10/lib/Class/Prototyped.pm
Class::Prototyped Tags
Class::Prototyped Description
Class::Prototyped is a fast prototype-based OO programming in Perl. Class::Prototyped is a fast prototype-based OO programming in Perl.SYNOPSIS use strict; use Class::Prototyped ':EZACCESS'; $, = ' '; $ = "n"; my $p = Class::Prototyped->new( field1 => 123, sub1 => sub { print "this is sub1 in p" }, sub2 => sub { print "this is sub2 in p" } ); $p->sub1; print $p->field1; $p->field1('something new'); print $p->field1; my $p2 = Class::Prototyped::new( 'parent*' => $p, field2 => 234, sub2 => sub { print "this is sub2 in p2" } ); $p2->sub1; $p2->sub2; print ref($p2), $p2->field1, $p2->field2; $p2->field1('and now for something different'); print ref($p2), $p2->field1; $p2->addSlots( sub1 => sub { print "this is sub1 in p2" } ); $p2->sub1; print ref($p2), "has slots", $p2->reflect->slotNames; $p2->reflect->include( 'xx.pl' ); # includes xx.pl in $p2's package print ref($p2), "has slots", $p2->reflect->slotNames; $p2->aa(); # calls aa from included file xx.pl $p2->deleteSlots('sub1'); $p2->sub1; Requirements: · Perl
Class::Prototyped Related Software