in reply to Useless use of private variable in void context
The first "$i" in the for loop causes the warning. "$i" at that point is a statement that does nothing and the resultant value is not used by anyone (normally an assignment occurs there) and hence the "useless use" warning.
This program will generate the same warning:
Change the for loop to#!/usr/bin/perl use strict; use warnings; my $y = 9; $y; exit 0;
and the warning will go away.for(;$i<$Size;$i++) {
|
|---|