in reply to Explicit package name Warning!!!

It means that you have a typo in a variable name in the code you're running that isn't there in the code you posted.

This message shows up because you violated strict 'vars' by using a variable name that hasn't been declared. It could be that you properly declared a variable, but later misspelled it.

Add "use diagnostics;" toward the top of your script and the error message will become more verbosely explained.


Dave

Replies are listed 'Best First'.
Re^2: Explicit package name Warning!!!
by m_alper_yildiz (Initiate) on Jun 04, 2013 at 22:20 UTC

    Can you tell me please what should i change or add in this code? Where do i have typo?

      the code you posted has no errors!

      try use diagnostics if you're facing again cryptic error msgs.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

      I cannot tell you exactly what you must change, because as I said in my original follow-up to your question, the code you posted doesn't contain the error you're reporting. However, I believe you are seeing an error message. So the code you're running has an error. The code you posted doesn't. You didn't copy and paste your buggy code; you re-typed it here and in so doing, avoided the typo that is causing the error in the code you're running.

      If you want your code to run just fine, copy what you typed here and paste it in place of your original code, because this code runs fine.


      Dave

      Yes. Copy the code you posted in your original question (aka OP, "Original Post", not to be confused... er, well, often confused because ambiguous with "Original Poster") and compare it, letter-by-letter, punct-by-punct; and space-by-space, if necessary, with the code that's giving you the problem. Doing so will reveal your typo.

      Then correct it or paste what you copied over your original code; add use strict; use warnings (not needed with 5.16 and higher update: if the script includes the line use 5.01n; where n is a relevant decimal digit) at the top, just after the hashbang. Voila; all should run as you expected, originally.

      Hint: when posting, copy and paste rather than retype. Doing so will save you the pain of discovering later that you've corrected an error or created a new one by retyping.


      If you didn't program your executable by toggling in binary, it wasn't really programming!

        Can you clarify:

        (not needed with 5.16 and higher)

        I am running Strawberry Perl 5.16.3 and I do not get any trouble with undeclared variables unless I use strict;