Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
System::Sub::AutoLoad(User Contributed Perl DocumentatSystem::Sub::AutoLoad(3)

NAME
       System::Sub::AutoLoad - Auto-wrap external commands as DWIM subs

VERSION
       version 0.162800

SYNOPSIS
   Basic usage
       Any unknown sub will become a "System::Sub".

	   use System::Sub::AutoLoad;

	   my $hostname	= hostname();

   Usage with forward declaration
       Allows to avoid using parentheses. "System::Sub"	import stays lazy.

	   use System::Sub::AutoLoad qw(hostname);

	   my $hostname	= hostname;

   Usage with forward declaration command options
       Options definitions will	be checked lazily at the first call to the
       AUTOLOAD	for that sub.

	   use System::Sub::AutoLoad hostname => [ 0 =>	'/bin/hostname'	];

	   my $hostname	= hostname;

DESCRIPTION
       Any unknown sub in your code will be transformed	into a "System::Sub"
       at its first call. This is lazy
       <http://en.wikipedia.org/wiki/Lazy_evaluation> import for
       "System::Sub".

       To avoid	using parentheses after	the sub	name, you usually have to
       predeclare the sub with either a	forward	declaration (a sub without
       body such as "sub foo;")	or with	the "subs" module. With
       "Sytem::Sub::AutoLoad" you can simply list the subs names on the	"use"
       line and	that will be done for you.

       You can also pass "System::Sub" options to the sub, but they will be
       lazily analysed:	this is	the full "System::Sub" power, but with lazy
       import.

   Implementation details
       This module exports an AUTOLOAD sub that	will import the	sub with
       "System::Sub" at	its first call.

AUTHOR
       Olivier MenguA(C), "dolmen@cpan.org".

COPYRIGHT & LICENSE
       Copyright A(C) 2012 Olivier MenguA(C).

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl 5 itself.

perl v5.24.1			  2016-10-06	      System::Sub::AutoLoad(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | AUTHOR | COPYRIGHT & LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=System::Sub::AutoLoad&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help