sub funky(&$) { my $sub=shift; my $string=shift; $sub->() foreach split //,$string; } funky {print $_} "yabbadabbadoo";