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


in reply to Scoping Rules For "our" Variables

rehmanz:

I must admit that I'm somewhat perplexed by your question: You provide some code and then ask what it should produce by itself and with use strict. If you try running it, perl will show you what it *should* produce. (Unless you've found a bug in perl--but that's not going to be likely!)

Your question about use strict shows that you're headed in the right direction, but if you try it with use warnings then perl will tell you why you're not getting the results you expect. In addition to the packages ones wind mentioned, you may find use diagnostics useful, too. It adds some information to the error messages that describe frequent causes of the errors and/or warnings. When I started learning perl, I used it frequently.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Update: I tweaked the first paragraph a tiny bit to make it flow better.