Sub::Call::Tail - Tail calls for subroutines and methods


Sub-Call-Tail documentation Contained in the Sub-Call-Tail distribution.

Index


Code Index:

NAME

Top

Sub::Call::Tail - Tail calls for subroutines and methods

SYNOPSIS

Top

    use Sub::Call::Tail;

    # instead of @_ = ( $object, @args ); goto $object->can("method")
    tail $object->method(@args);

    # instead of @_ = @blah; goto &foo
    tail foo(@blah);

DESCRIPTION

Top

This module provides a tail modifier for subroutine and method calls that will cause the invocation to have the same semantics as goto &sub.

When the tail modifier is compiled the inner subroutine call is transformed at compile time into a goto.

SEE ALSO

Top

B::Hooks::OP::Check::EntersubForCV

CPS

VERSION CONTROL

Top

http://github.com/nothingmuch/Sub-Call-Tail

AUTHOR

Top

Yuval Kogman

Andrew Main (Zefram)

COPYRIGHT & LICENSE

Top


Sub-Call-Tail documentation Contained in the Sub-Call-Tail distribution.

package Sub::Call::Tail;

use strict;
use warnings;

require 5.008001;
use parent qw(Exporter DynaLoader);
use B::Hooks::OP::Check::EntersubForCV;

our $VERSION = '0.04';
$VERSION = eval $VERSION;

our @EXPORT = our @EXPORT_OK = qw(tail);
our %EXPORT_TAGS = ( all => \@EXPORT_OK );

__PACKAGE__->bootstrap($VERSION);

pop our @ISA;

# ex: set sw=4 et:

__PACKAGE__

__END__