| You can refer to non-my variables by name, the syntax looks like this:
$frequency2 = 10;
my $var_name = "frequency2";
print $$var_name, "\n";
but you probably don't want to. If you have a list of frequencies, you probably want to use an array. E.g.,
my @frequencies = (10, 20, 30);
for (my $i = 0; $i < 2; ++$i) {
print $frequencies[$i], "\n";
}
Or, you could use foreach, map, etc. to iterate over the array. |