这是一个令人尴尬的问题,但为什么这条线有效而另一条线无效?
工作线:
use strict;
use warning;
use Wx qw(:everything);
my $dialog = Wx::MessageDialog->new(
$self,
"About test\n" . "Version 0.01\n",
"About Test",
wxOK | wxCENTRE
);
非工作线:
use strict;
use warning;
use Wx;
my $dialog = Wx::MessageDialog->new(
$self,
"About test\n" . "Version 0.01\n",
"About Test",
wxOK | wxCENTRE
);
来自非工作行的错误消息:
Bareword "wxOK" not allowed while "strict subs" in use at test.pl line 123.
Bareword "wxCENTRE" not allowed while "strict subs" in use at test.pl line 123.
BEGIN not safe after errors--compilation aborted at test.pl line 348.