use feature ":5.14"; use warnings FATAL => qw(all); use strict; use Data::Dump qw(dump pp); my $wheel = 2100; my @chwhs = qw (23 26 27); # test data my @cogs = qw (11 13 15 17 19 21 24 28 32); # test data my $gear; for my $c(0..2) {$gear->[$c][$_] = $wheel*$chwhs[$c]/$cogs[$_] for 0..8; } pp($gear);