Jenda Krynicky wrote:
I think the original problem is with using use strict because 1. someone told you to or 2. you were told you have to do so for mod_perl. It's not really "use strict" that's required by mod_perl.

Yep, I agree (and admit).

In either case what wording would you suggest?

Maybe

'$var' not declared, requires explicit package name if global

?

I think that would be better, since it does not necessarily lead you in the wrong direction. If I don't know what "declared" means, I can e.g. check the explanation in perldiag or google for it.

Or maybe:

'$var' needs to be declared or called with its fully qualified name

That's even better IMO, because it does not preclude our() declarations, and both "declared" and "fully qualified" are possible to look up. It would give you a hint that it's more into it than just adding the package name. (Such a hint would have been really useful in my case.)

Though I bet people will be confused in cases like

 perl -Mstrict -e 'local $var = 4'

because quite a few people think "local $foo" is a declaration.

I for one don't see how a more informative error message could hurt.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to