Jump to content

Perl Programming/Keywords/AUTOLOAD

From Wikibooks, open books for an open world
Previous: atan2 Keywords Next: BEGIN

The AUTOLOAD keyword

[edit | edit source]

AUTOLOAD is a keyword that is used to mark a subroutine for autoloading. This subroutine is called, if a subroutine that doesn't exist was called with exactly the same number of arguments.

Syntax

[edit | edit source]
  sub AUTOLOAD BLOCK

Examples

[edit | edit source]
sub AUTOLOAD {
  my $callit = $AUTOLOAD;
  []
  system($callit, @_);
}
Previous: atan2 Keywords Next: BEGIN