Perl Programming/Keywords/prototype

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: printf Keywords Next: push

The prototype keyword[edit | edit source]

The prototype function returns the prototype of a function with the name "FUNCTION" as a string. If FUNCTION is a string that starts with CORE::, the rest is understood as a Perl builtin. If the arguments cannot be expressed by a prototype or the function does not have any, undef is returned. Otherwise, the string describing the equivalent prototype is returned.

From Perl 5.14.0 onwards, a scalar EXPRESSION can be passed that should hold a reference to an unblessed array. The argument is dereferenced automatically. This is a highly experimental aspect of prototype and may change in future Perl versions.

Syntax[edit | edit source]

  prototype FUNCTION

See also[edit | edit source]

Previous: printf Keywords Next: push