use Useful::For qw[ ForRange ]; ForRange \my $i, 1, 10, { print $$i; }