So I have a foreach
loop:
foreach (1..10) {
print "#", $t, "\n";
}
But I also have a scalar:
$number = 5;
Can I count from 1 to the scalar like so?
foreach (1..$number) {
print "#", $t, "\n";
}
When I do this, the program simply outputs nothing. What can I do to make this work?