Goto::Cached - a fast drop-in replacement for Perl's O(n) goto
sub factorial($) { use Goto::Cached; my $n = shift; my $accum = 1; iter: return $accum if ($n < 2); $accum *= $n; --$n; goto iter; }
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.
goto
goto &sub
0.22
Acme::Goto::Line
chocolateboy <chocolate@cpan.org>
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.
To install Goto::Cached, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Goto::Cached
CPAN shell
perl -MCPAN -e shell install Goto::Cached
For more information on module installation, please visit the detailed CPAN module installation guide.