perl-Autoload-AUTOCAN-0.005-alt1.noarch.rpm


Advertisement

Description

perl-Autoload-AUTOCAN - Easily set up autoloading

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-Autoload-AUTOCAN
Package version 0.005
Package release alt1
Package architecture noarch
Package type rpm
Installed size 24.57 KB
Download size 24.57 KB
Official Mirror ftp.altlinux.org
Autoloading is a very powerful mechanism for
dynamically handling function calls that are not defined. However, its
implementation is very complicated. For the simple case where you wish to
allow method calls to methods that don't yet exist, this module allows you to
define an `AUTOCAN' method which will return either a code reference or
`undef'.
the Autoload::AUTOCAN manpage installs an `AUTOLOAD' subroutine in the current package,
which is invoked when an unknown method is called. The installed `AUTOLOAD'
will call `AUTOCAN' with the invocant (class or object the method was called
on) and the method name. If `AUTOCAN' returns a code reference, it will be
called with the same arguments as passed to the unknown method (including the
invocant). If `AUTOCAN' returns `undef', an error will be thrown as expected
when calling an undefined method.
Along with `AUTOLOAD', the module installs a `can' method which returns code
references as normal for defined methods (see the UNIVERSAL manpage), and delegates to
`AUTOCAN' for unknown methods.
`AUTOLOAD' affects standard function calls in addition to method calls. By
default, the `AUTOLOAD' provided by this module will die (as Perl normally
does without a defined `AUTOLOAD') if a nonexistent function is called without
a class or object invocant. If you wish to autoload functions instead of
methods, you can pass `functions' as an import argument, and the installed
`AUTOLOAD' will autoload functions using `AUTOCAN' from the current package,
rather than using the first argument as an invocant.
package My::Functions;
use Autoload::AUTOCAN 'functions';
sub AUTOCAN {
my ($package, $function) = @_;
return sub { $_[0]x5 } if $function =~ m/dup/;
return undef;
}
say My::Functions::duplicate('foo'); # foofoofoofoofoo
say My::Functions::foo('bar'); # undefined subroutine error

Alternatives

Package Version Architecture Repository
perl-Autoload-AUTOCAN - - -

Requires

Name Value
/usr/share/perl5 -
perl(Scalar/Util.pm) -
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(Autoload/AUTOCAN.pm) = 0.005
perl-Autoload-AUTOCAN = 0.005-alt1

Download

Type URL
Binary Package perl-Autoload-AUTOCAN-0.005-alt1.noarch.rpm
Source Package perl-Autoload-AUTOCAN-0.005-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Autoload-AUTOCAN rpm package:
    # sudo apt-get install perl-Autoload-AUTOCAN

Files

Path
/usr/share/doc/perl-Autoload-AUTOCAN-0.005/CONTRIBUTING.md
/usr/share/doc/perl-Autoload-AUTOCAN-0.005/Changes
/usr/share/doc/perl-Autoload-AUTOCAN-0.005/LICENSE
/usr/share/doc/perl-Autoload-AUTOCAN-0.005/README
/usr/share/perl5/Autoload/AUTOCAN.pm

See Also

Package Description
perl-Aviation-Report-1.02-alt1.noarch.rpm Perl extension for translating U.S. METAR, TAF and PIREP textual reports into plain English
perl-Aws-Polly-Select-20171217-alt1.noarch.rpm Select AWS Polly speakers with specified characteristics
perl-AxKit-Plugin-DisableXSLTParams-0.01-alt1.noarch.rpm perl module AxKit-Plugin-DisableXSLTParams
perl-AxKit-XSP-Wiki-0.07-alt1.noarch.rpm perl module AxKit-XSP-Wiki
perl-AxKit2-1.1-alt2.noarch.rpm XML Application Server
perl-AxKit2-scripts-1.1-alt2.noarch.rpm AxKit2 scripts
perl-B-CodeLines-1.1-alt2_8.noarch.rpm Lists executable lines of a Perl Program
perl-B-Debugger-0.14-alt1.noarch.rpm optree debugger
perl-B-DeparseTree-2.1.5-alt1.noarch.rpm Like B::Deparse, but keeps tree structure indexable by OP address
perl-B-Fathom-0.07-alt1.noarch.rpm perl module B-Fathom
perl-B-Lint-Pluggable-2.0-alt1.noarch.rpm Adds plugin support to B::Lint
perl-B-Lint-StrictOO-0.04-alt1.noarch.rpm Apply strict to classes and methods
perl-B-LintSubs-0.06-alt1.noarch.rpm Perl compiler backend to check sub linkage
perl-B-OptreeShortestPath-0.02-alt1.noarch.rpm perl module B-OptreeShortestPath
perl-B-RecDeparse-0.10-alt1.noarch.rpm Deparse recursively into subroutines
Advertisement
Advertisement