【发布时间】:2018-08-06 16:50:21
【问题描述】:
我有这个代码:
my %options;
$options{"style"}{size} = "mini";
$options{"style"}{color} = "secondary";
diag("size=".$options{style}{size});
$self->applyStyle(%options);
然后:
sub applyStyle {
my ($self, $options) = @_;
diag("size=".$options->{style}{size});
}
但我明白了:
Can't use string ("style") as a HASH ref while "strict refs" in use at ...
如何打印(和使用)这些值?
【问题讨论】: