projects
/
catagits/HTML-Zoom.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
basic stuff working
[catagits/HTML-Zoom.git]
/
lib
/
HTML
/
Zoom
/
CodeStream.pm
1
package HTML::Zoom::CodeStream;
2
3
use strict;
4
use warnings FATAL => 'all';
5
6
sub from_array {
7
my ($class, @array) = @_;
8
$class->new({ code => sub {
9
return unless @array;
10
return shift @array;
11
}});
12
}
13
14
sub new {
15
my ($class, $args) = @_;
16
bless({ _code => $args->{code} }, $class);
17
}
18
19
sub next {
20
$_[0]->{_code}->()
21
}
22
23
1;
24