From: Matt S Trout Date: Sat, 20 Feb 2010 22:37:11 +0000 (+0000) Subject: add map method to Data::Perl::Stream::Array X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9e6828e241c1e305e09446a0d91678ebf14d8648;p=dbsrgits%2FDBIx-Data-Store-old.git add map method to Data::Perl::Stream::Array --- diff --git a/lib/Data/Perl/Stream/Array.pm b/lib/Data/Perl/Stream/Array.pm index 7c0cd09..8d4f325 100644 --- a/lib/Data/Perl/Stream/Array.pm +++ b/lib/Data/Perl/Stream/Array.pm @@ -15,6 +15,10 @@ method next { return shift @$ary; } +method map ($map_func) { + ref($self)->new(array => [ map { $map_func->($_) } @{$self->_array} ]); +} + __PACKAGE__->meta->make_immutable; 1;