Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Are the curly braces around each package necessary? the code appears to work without them. What purpose do they serve?{ package Animal; sub speak { our $class = shift; print "a $class goes ", $class->sound, "!\n"; } } { package Cow; our @ISA = qw(Animal); sub sound { "moooo" } } Animal::speak("Cow");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: package question
by merlyn (Sage) on Jan 09, 2006 at 17:12 UTC | |
|
Re: package question
by Roy Johnson (Monsignor) on Jan 09, 2006 at 17:14 UTC |