in reply to Re: Explicit package name Warning!!!
in thread Explicit package name Warning!!!

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

Replies are listed 'Best First'.
Re^3: Explicit package name Warning!!!
by LanX (Saint) on Jun 04, 2013 at 22:24 UTC
    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)

Re^3: Explicit package name Warning!!!
by davido (Cardinal) on Jun 05, 2013 at 00:09 UTC

    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

Re^3: Explicit package name Warning!!!
by Anonymous Monk on Jun 04, 2013 at 22:28 UTC
Re^3: Explicit package name Warning!!!
by ww (Archbishop) on Jun 05, 2013 at 13:47 UTC
    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;

        Can't say whether my hasty comment is applicable to Strawberry's implementation, but, clarifying and correcting the parenthetical statement at least with respect to my flavor (ActiveState):

        (not needed with 5.016 and higher if the script includes the line use 5.01n; where n is a relevant decimal digit)


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