GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
System::Sub::AutoLoad(3) User Contributed Perl Documentation System::Sub::AutoLoad(3)

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

version 0.162800

Any unknown sub will become a "System::Sub".

    use System::Sub::AutoLoad;

    my $hostname = hostname();

Allows to avoid using parentheses. "System::Sub" import stays lazy.

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

    my $hostname = hostname;

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;

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.

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

Olivier Mengué, "dolmen@cpan.org".

Copyright © 2012 Olivier Mengué.

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

2016-10-06 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.