in reply to for loop to get the 3rd index

What is i in your for loop? It's not a variable. I think you meant:

for(my $i = 0; $i < 9; $i++) { . . . }

Which can be written more simply as:

for my $i (0 .. 8) { . . . }

Where is @_ coming from? $_ is not the same as @_. As far as perl is concerned those two variables are only similar in that they share a glob.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated