Acme-Loopy
view release on metacpan or search on metacpan
Maintainer: Toby Inkster (TOBYINK) <tobyink@cpan.org>
0.004 2014-09-10
[ Packaging ]
- Switch to Dist::Inkt.
0.003 2012-12-15
- Perl 5.12 compat
- Test that ${^LOOP} is undefined after the loop has finished.
0.002 2012-12-03
- ${^LOOP} is now zero-based. It was previously one-based but that was
undocumented. Having it false on the first journey around the loop seems
to enable some nice idioms.
0.001 2012-12-02 Initial release
doap:file-release <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/Acme-Loopy-0.002.tar.gz>;
doap:revision "0.002"^^xsd:string.
<http://purl.org/NET/cpan-uri/dist/Acme-Loopy/v_0-003>
a doap:Version;
dc:identifier "Acme-Loopy-0.003"^^xsd:string;
dc:issued "2012-12-15"^^xsd:date;
doap-changeset:changeset [
doap-changeset:item [
a doap-changeset:Change;
rdfs:label "Test that ${^LOOP} is undefined after the loop has finished.";
], [
a doap-changeset:Change;
rdfs:label "Perl 5.12 compat";
];
];
doap-changeset:released-by <http://purl.org/NET/cpan-uri/person/tobyink>;
doap:file-release <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/Acme-Loopy-0.003.tar.gz>;
doap:revision "0.003"^^xsd:string.
<http://purl.org/NET/cpan-uri/dist/Acme-Loopy/v_0-004>
lib/Acme/Loopy.pm view on Meta::CPAN
my $rand = 99_999 + int rand 900_000;
substr($$ref, 0, 0) =
q{ local ${^_LOOP_OLD} = ${^LOOP}; } .
q{ local ${^_LOOP_CURRENT} = -1; } .
q{ while ( ${^LOOP} = ++${^_LOOP_CURRENT}, my $__guard_}.$rand.q{ = Acme::Loopy::Guard->new(${^_LOOP_OLD}, \${^LOOP}) )};
};
}
sub unimport
{
Keyword::Simple::undefine loop => ();
}
}
{
package Acme::Loopy::Guard;
our $AUTHORITY = 'cpan:TOBYINK';
our $VERSION = '0.004';
sub new
t/01basic.t view on Meta::CPAN
last if ${^LOOP} > 3;
}
is $sum, 5406614024;
loop {
ok not ${^LOOP};
last;
};
is ${^LOOP}, undef;
( run in 2.572 seconds using v1.01-cache-2.11-cpan-d80b1682f3f )