in reply to The error says the value is uninitialized, but it works anyway
foreach $num (reverse 1..$count){
I recommend against using a previously defined lexical variable as a loop variable. It does not make any difference in this script, but it is a bad practice. In the future, you may be tempted to use that variable after the loop has finished and it almost certainly will not contain what you expect. Use the syntax haukex showed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The error says the value is uninitialized, but it works anyway (updated)
by AnomalousMonk (Archbishop) on Aug 17, 2019 at 17:29 UTC |