请解释为什么在函数定义之上调用这些Perl函数的方式决定了它们是否运行.
print "Why does this bare call to foo not run?\n";
foo;
print "When this call to foo() does run?\n";
foo();
print "And this call to &foo also runs?\n";
&foo;
sub foo {
print " print from inside function foo:\n";
}
print "And this bare call to foo below the function definition, does run?\n";
foo;
Run Code Online (Sandbox Code Playgroud) perl ×1