my $one = "wired"; for my $two (grep 1, substr($one, 1, 3)) { sub { $_[0] = "eir" } -> ($two); } print $one;