I am new to Perl and am trying to write a script that will only print the even numbered lines of an array. I have tried multiple different methods of finding the size to use as the condition for my while loop, but I always end up getting an infinite loop of the first line without the program terminating. The array being input is a text file, input with the form "program.pl < foo.txt". Have I made a logic or syntax error?

```
@input = <STDIN>;
$i = $1;
$size = $#input + $1;
while ($size >= $i) {
        print "$input[$i]";
        $i = ($i + $2);
}

```