http://www.perlmonks.org?node_id=779637


in reply to Help with 'use Warnings' please?

There's quite a bit of important code missed out of your example, so it's hard to know exactly what's going wrong. Using strict as well as warnings would probably help.

Sounds like it's some kind of scoping issue in your closure. Try adding use diagnostics to your code and see if that gives more detail.

--

See the Copyright notice on my home node.

Perl training courses

Replies are listed 'Best First'.
Re^2: Help with 'use Warnings' please?
by JavaFan (Canon) on Jul 13, 2009 at 15:57 UTC
    Using strict as well as warnings would probably help.
    Looking at perldiag at the entry for the warning which is closest what is quoted by the OP, using strict would not help. In fact, it can only happen with lexicals - it shouldn't happen with package variables.
Re^2: Help with 'use Warnings' please?
by wa4otj (Beadle) on Jul 13, 2009 at 17:00 UTC
    I could have posted the entire example, but it would have been much too long. I am using strict, and the code I posted does in fact show pretty much exactly what is going on.

    I will experiment with 'use diagnostics' and see what that reveals. Thanks for the suggestion.

    Nat

      I could have posted the entire example, but it would have been much too long. I am using strict, and the code I posted does in fact show pretty much exactly what is going on.

      The best way to get help here is to post a self-contained program which exhibits your problem. If we can run your program, then it's far more likely that we'll be able to find the issue.

      I find that in the process of cutting a program down to an example that illustrates a particular problem, it often gives me a different perspective and enables me to find a solution without even posting here.

      --

      See the Copyright notice on my home node.

      Perl training courses