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 !
In reply to mutliplying each element of a list by the same number by steph_bow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |