package One; sub data { print $_ while <DATA>; } 1; __DATA__ here we have the data section of One.pm package Two; our @ISA = qw(One); sub new { my $self = {}; bless $self, __PACKAGE__; } 1; __DATA__ here we have the data section of Two.pm # and a script to use them: use lib '.'; use One; use Two; my $two = Two->new; $two->data; ### and the output: $ perl script.pl here we have the data section of One.pm
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality.
In reply to odd: __DATA__ sections are not polymorphic by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |