|
Array::Stream::Transactional - Transactional array wrapper |
use Array::Stream::Transactional;
my $stream = Array::Stream::Transactional->new([1..100]);
$stream->commit;
while($stream->has_more) {
if($stream->next == 50 && !$reverted) {
$stream->rollback;
$reverted = 1;
}
print $stream->current, "\n";
}
Array::Stream::Transactional is a Perl extension for wrapping an array and having it pose as a stream. The streams current position can be commited and rollbacked at any time.
Array::Stream::Transactional. Wrapps the passed array reference. Position is set to 0, current is set the first element in ARRAYREF, previous is set to undef and the transaction stack is empty.
Claes Jacobsson, claesjac@cpan.org
Copyright 2004 by Claes Jacobsson
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Array::Stream::Transactional - Transactional array wrapper |