#!/usr/bin/perl use diagnostics -verbose; use 5.010; use strict; use warnings; open (DATA, 'text.log') or die print $!; binmode DATA #I am trying everything I can while () { @line = split(/ /,$_); $test = $line[2]; if ($test == '') { say "$test\n"; } } close DATA; #### DESCRIPTION OF DIAGNOSTICS These messages are classified as follows (listed in increasing order of desperation): (W) A warning (optional). (D) A deprecation (optional). (S) A severe warning (default). (F) A fatal error (trappable). (P) An internal error you should never see (trappable). (X) A very fatal error (nontrappable). (A) An alien error message (not generated by Perl). The majority of messages from the first three classifications above (W, D & S) can be controlled using the warnings pragma. If a message can be controlled by the warnings pragma, its warning category is included with the classification letter in the description below. Default warnings are always enabled unless they are explicitly disabled with the warnings pragma or the -X switch. Trappable errors may be trapped using the eval operator. See perlfunc/eval. In almost all cases, warnings may be selectively disabled or promoted to fatal errors using the warnings pragma. See warnings. syntax error at Monks/Snippet.pm line 9, near ") {" Global symbol "@line" requires explicit package name at Monks/Snippet.pm line 10. ... lots more stuff ... #### DESCRIPTION OF DIAGNOSTICS ...same as above... Trappable errors may be trapped using the eval operator. See perlfunc/eval. In almost all cases, warnings may be selectively disabled or promoted to fatal errors using the warnings pragma. See warnings. Global symbol "@line" requires explicit package name at Monks/Snippet.pm line 9. Global symbol "$test" requires explicit package name at Monks/Snippet.pm line 10. Global symbol "@line" requires explicit package name at Monks/Snippet.pm line 10. Global symbol "$test" requires explicit package name at Monks/Snippet.pm line 11. Global symbol "$test" requires explicit package name at Monks/Snippet.pm line 13. Execution of Monks/Snippet.pm aborted due to compilation errors (#1) (F) You've said "use strict vars", which indicates that all variables must either be lexically scoped (using "my"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::").