Ron Weidner wrote:
In the program below the "for loop" is causing the warning...
"Useless use of private variable in void context at ./uselessUse.pl line 16."
If I comment out the "for loop" like this the warning goes away...
#for($i; $i< $n; $i++)
^^
The first $i is in void context
Hello Ron,
> for($i; $i < $n; $i++)
When Perl evaluates the initialiser of the for loop, it just sees a `$i`.
There are no effects for such a statement. Hence the warning. For getting more
details about warnings, you can use the diagnostics pragma. (See `perldoc
diagnostics`)
Since yo
In the program below the "for loop" is causing the warning...
"Useless use of private variable in void context at ./uselessUse.pl line 16."
If I comment out the "for loop" like this the warning goes away...
#for($i; $i < $n; $i++)
#{
push (@some_array, $i);
#}
What does the warning mean and