$ perl -E 'my $fetch = sub { say "fetching ..." }; $fetch->() for 1 ..2' fetching ... fetching ...