foreach $datum (@data) { $datum->print_me(); }
@data = (
XML::File->new("./lamasery.xml");
HTTP::get->new("http://www.perl.org/news.html");
Signature->new();
}
print_me() method, the method call will handle $datum->print_me(); correctly. (Damian Conway, Object Oriented Perl, p. 204.)
| Previous | Back to start of show | Next |
| Slide: 41 interface_polymorphism | © 2003 James E. Keenan |