Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

implicit invoker, sort of

tree: e61618a29e

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 xt
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .shipit
Octocat-spinner-32 Changes
Octocat-spinner-32 MANIFEST
Octocat-spinner-32 MANIFEST.SKIP
Octocat-spinner-32 Makefile.PL
Octocat-spinner-32 README
Octocat-spinner-32 invoker.xs
Octocat-spinner-32 typemap
README
NAME
    invoker - implicit invoker, sort of

SYNOPSIS
      use invoker;

      sub foo {
        my $self = shift;
        $->bar; # calls $self->bar;
      }

      # use Method::Signatures::Simple
      # 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,
    <Method::Signatures::Simple>, or other similar modules.

    The following syntax works:

    $->foo( .. args ...)
    $->foo
    $->$method_name
    $->$method_name( .. args ...)

CAVEATS
    WARNINGS WARNINGS WARNINGS

    This is alpha code. Do not use in production.

    Internally, the module installs a parser hook to replace "$->" ($- and
    the gt operator) with $--> (an invocation on the $- perlvar. It also
    injects an entersub hook to replace $- with $self .

BUGS
TODO
    custom invoker name with "use invoker '$this'"

AUTHOR
    Chia-liang Kao <clkao@clkao.org>

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

SEE ALSO
Something went wrong with that request. Please try again.