G'day m_alper_yildiz,
Welcome to the monastery.
I note in a number of the replies here, use of the diagnostics pragma is suggested. Instead of editing and rerunning your code, you can look up the verbose diagnostic messages in perldiag.
There are a very large number of messages in perldiag so you'll probably need to search for the one you want. Be aware that variable parts of the message (e.g. the "some variable" in your post) are usually shown as "%s"; accordingly, just search for a significant, non-variable part (e.g. 'requires explicit package name' finds 'Global symbol "%s" requires explicit package name' but '"$x" requires explicit package name' finds no matches).
Alternatively, you can feed the entire, unedited message to splain (see perldiag - The splain Program). Here's an example:
$ splain /Users/ken/perl5/perlbrew/perls/perl-5.18.0t/bin/splain: Reading from +STDIN Global symbol "$x" requires explicit package name Global symbol "$x" requires explicit package name (#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 "::"). ^C
While you are learning Perl, the diagnostics pragma can be useful; however, it is generally not a good idea to retain it in production code. Here's a non-exhaustive list of reasons why not to use this pragma in production code:
-- Ken
In reply to Re: Explicit package name Warning!!!
by kcott
in thread Explicit package name Warning!!!
by m_alper_yildiz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |