Copyright © tutorialspoint.com

PERL prototype Function


Syntax

prototype EXPR


Definition and Usage

Returns a string containing the prototype of the function or reference specified by EXPR, or undef if the function has no prototype.

You can also use this to check the availability of built-in functions.

Return Value

  • undef if no function prototype

  • string containing the prototype of the function or reference specified by EXPR

Example

Try out following example:

#!/usr/bin/perl -w

$func_prototype = prototype ( "myprint" );
print "myprint prototype is $func_prototype\n";

sub myprint($$){
  print "This is test\n";
}

It will produce following results:

myprint prototype is $$

Copyright © tutorialspoint.com