"packages" organize the code into namespace units. This is what it looks without them:
sub One::new { my $class = shift; print "creating object of class $class\n"; bless {}, $class; } @Two::ISA = ("One"); my $one = One->new(); my $two = Two->new(); # creating object of class One # creating object of class Two
In reply to Re: Learning how to use inheritance...
by fglock
in thread Learning how to use inheritance...
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |