目录

prototype

描述 (Description)

此函数返回一个字符串,其中包含EXPR指定的函数或引用的原型,如果函数没有原型,则返回undef。

您还可以使用它来检查内置函数的可用性。

语法 (Syntax)

以下是此函数的简单语法 -

prototype EXPR

返回值 (Return Value)

如果没有函数原型else返回包含EXPR指定的函数或引用原型的字符串,则此函数返回undef。

例子 (Example)

以下是显示其基本用法的示例代码 -

#!/usr/bin/perl -w
$func_prototype = prototype ( "myprint" );
print "myprint prototype is $func_prototype\n";
sub myprint($$) {
   print "This is test\n";
}

执行上述代码时,会产生以下结果 -

myprint prototype is $$
↑回到顶部↑
WIKI教程 @2018