Inheritance/Single: Difference between revisions
m
→{{header|Perl}}: 5*s->1
m (→{{header|OCaml}}: 5*s->1) |
m (→{{header|Perl}}: 5*s->1) |
||
Line 1,677:
=={{header|Perl}}==
<syntaxhighlight lang="perl">
package Animal;
#functions go here...
1;
1;</syntaxhighlight>▼
use Animal;
@ISA = qw( Animal );
#functions go here...
1;
use Animal;
@ISA = qw( Animal );
#functions go here...
1;
use Dog;
@ISA = qw( Dog );
#functions go here...
1;
use Dog;
@ISA = qw( Dog );
#functions go here...
1;
# The same using the [http://search.cpan.org/perldoc?MooseX::Declare MooseX::Declare] module:
class Animal {
Line 1,723 ⟶ 1,724:
class Collie extends Dog {
# methods go here...
}
=={{header|Phix}}==
|