http://www.perlmonks.org?node_id=81209


in reply to Defining Arrays

The .. operator steps by one, you can't change that behavior. But you can do it with a for loop:
my @results; for (my $i=0; $i <= 79; $i++) { push @results, ($i/10+1.5); }
It seems a bit awkward but it give's you the right result. Please notice that I didn't loop from 1.5 to 9.4 with a stepping of .1 for that would get imprecise (I got with a quick perl -e test 5.99999999999999 instead of 6). You can't go precisely if you are calculating with floats.
--
use signature; signature(" So long\nAlfie");