steph_bow has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I would like to know if there is a simple way to multiply each element of a list by the same number. I would like to do, for example : 10* (1..10);
use strict; my $max = $ARGV[0]; my @ratio_list = (0,1..$max); my @minutes_list; foreach my $k(@ratio_list){ my $inter = 10 * $ratio_list[$k]; if ($inter != 0){ push @minutes_list, $inter; } }
Thanks a lot !
|
|---|