Global symbol "$files" requires explicit package name at 1.pl line 19. Execution of 1.pl aborted due to compilation errors (#1) (F) You've said "use strict" or "use strict vars", which indicates that all variables must either be lexically scoped (using "my" or "state"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::"). #### foreach (@files) { $files = $_; #etc... #### for my $i ( 0 .. 10 ) { print "$i\n" } open my $fh, '<', "/etc/passwd"; while (my $line = <>) { next if /^\s*#/ }