NAME
Goto::Cached - a fast drop-in replacement for Perl's O(n) goto
SYNOPSIS
use Goto::Cached;
my $label = 'LABEL3';
goto LABEL1;
LABEL1: goto $label;
LABEL2: print "Not reached!", $/;
LABEL3: print "label3!", $/;
DESCRIPTION
Goto::Cached provides a fast, lexically-scoped drop-in replacement for Perl's builtin goto
. Its use is the same as the builtin. goto &sub
and jumps out of the current scope are not cached.
In a simple benchmark (see t/benchmark.t
), static goto
s are approximately 6 times faster than the builtin, and dynamic goto
s are approximately 1.6 times faster.
VERSION
0.20
SEE ALSO
AUTHOR
chocolateboy <chocolate@cpan.org>
COPYRIGHT
Copyright (c) 2005-2010, chocolateboy.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.