Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Transform Sequence Problem

by Anonymous Monk
on Jun 19, 2013 at 19:46 UTC ( #1039834=note: print w/replies, xml ) Need Help??

in reply to Transform Sequence Problem

dominus's Higher-Order Perl, the chapter about iterators?
use Iterator_Utils qw/:all/; my @data = (1, 2, 3); my $data_iter = list_iterator(@data); $f1 = sub { $_ + 1 }; $f2 = sub { log($_) }; $f3 = sub { $_ * 3 }; my $iter = $data_iter; for my $func ($f1, $f2, $f3) { $iter = imap($func, $iter); } while (my $item = NEXTVAL($iter)) { print $item, "\n"; }
( available at his web site)
# output 2.07944154167984 3.29583686600433 4.15888308335967

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039834]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-10-22 02:26 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.