## using an array my @calcs = some_function(); for(@calcs[0 .. 3]) { ... } ## using a hash for my $k (map "calc$_", 1 .. 4) { do_stuff( $calc{$k} ); ... }