Scalar value @filenames[$i] better written as $filenames[$i] at xx.pl line 71 (#1) (W syntax) You've used an array slice (indicated by @) to select a single element of an array. Generally it's better to ask for a scalar value (indicated by $). The difference is that $foo[&bar] always behaves like a scalar, both when assigning to it and when evaluating its argument, while @foo[&bar] behaves like a list when you assign to it, and provides a list context to its subscript, which can do weird things if you're expecting only one subscript. On the other hand, if you were actually hoping to treat the array element as a list, you need to look into how references work, because Perl will not magically convert between scalars and lists for you. See perlref. Possible unintended interpolation of @filenames in string at xx.pl line 71. Scalar found where operator expected at xx.pl line 72, near "] $title" (#2) (S) The Perl lexer knows whether to expect a term or an operator. If it sees what it knows to be a term when it was expecting to see an operator, it gives you this warning. Usually it indicates that an operator or delimiter was omitted, such as a semicolon. Global symbol "@pages" requires explicit package name at xx.pl line 11. Global symbol "@filenames" requires explicit package name at xx.pl line 12. Global symbol "@titles" requires explicit package name at xx.pl line 13.