-
-
28 Oct 2019 23:28:00 UTC
- Distribution: invoker
- Module version: 0.36
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (29 / 0 / 2)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (70.02KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- B::Hooks::EndOfScope
- B::Hooks::OP::Check
- B::OPCheck
- Devel::Declare
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
invoker - implicit invoker, sort of
SYNOPSIS
use invoker; sub foo { my $self = shift; $->bar; # calls $self->bar; } use methods-invoker; method { $->bar # ditto }
DESCRIPTION
The invoker pragma enables the
$->
syntax for invoking methods on$self
, inspired by Perl6's$.method
invocation.The module does not inject the
$self
variable for you. you are encouraged to use it in conjunction with self, selfvars, <Method::Signatures::Simple>, or other similar modules.The following syntax works:
CAVEATS
Regular hash access must still be written as
$self->{attr}
instead of$->{attr}
.Internally, the module installs a parser hook to replace
$->
($-
and the gt operator) with $--> (an invocation on the$-
perlvar. It also injects anentersub
hook to replace$-
with$self
.BUGS
TODO
AUTHOR
Chia-liang Kao <clkao@clkao.org> Audrey Tang <audreyt@audreyt.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Module Install Instructions
To install invoker, copy and paste the appropriate command in to your terminal.
cpanm invoker
perl -MCPAN -e shell install invoker
For more information on module installation, please visit the detailed CPAN module installation guide.