for INDEX: @ARGV is an array of command line arguments. Since you only have 1, the filename, its going to be zero in all cases.
For SYNTAX:
To quote Larry Wall (an important guy if you program perl) "There's more then one way to do it." If your instructor is looking for a specific answer...