请看下面的代码:
use strict;
use warnings;
print "subroutine is defined\n" if defined &myf;
myf();
sub myf
{
print "called myf\n";
}
undef &myf;
#myf();
print "now subroutine is defined\n" if defined &myf;
输出是
subroutine is defined
called myf
第一条print
语句可以打印,这是否意味着解释器(或编译器?)进一步查看并看到子例程定义?如果是这样,为什么它不将第二个语句undef &myf;
视为第二个print
语句?
谢谢