$ steps.pl 1 10 5 1, 3.25, 5.5, 7.75, 10 $ steps.pl 10.5 -10.7 4 10.5, 3.43333333333333, -3.63333333333333, -10.7 #### #!/usr/bin/perl use strict; use warnings; my ($first, $second, $steps) = @ARGV; $steps = int $steps; my $increment = ($second - $first) / ($steps - 1); my @array = ($first); for (2..$steps) { push @array, $first += $increment; } print join(", ", @array) . "\n";