#!/usr/bin/perl use Coro; use Coro::Cont; sub mul23 : Cont { yield 2*shift; yield 3*shift; } my %hash = (1,10,2,20,3,30); %hash = map mul23($_), %hash; print join(",", %hash), "\n"; # here is a random-number generator sub badrand : Cont { my $seed = 1; while() { $seed = $seed * 121 % 97; yield $seed % $_[0]; } } print badrand($_), " " for 1..30; print "\n";