📄 程嶏清单14-14.txt
字号:
# The Coffee.pm file to illustrate inheritance.
package Coffee;
require Exporter;
require Bean;
@ISA = qw(Exporter, Bean);
@EXPORT = qw(setImports, declareMain, closeMain);
sub setCoffeeType # set item
{
my ($class,$name) = @_;
$class->{'Coffee'} = $name;
print "Set coffee type to $name \n";
}
sub new # constructor
{
my $type = shift;
my $this = Bean->new(); ##### <- LOOK HERE!!! ####
$this->{'Coffee'} = 'Instant'; # unless told otherwise
bless $this, $type;
return $this;
}
1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -