In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Markus Treinen) writes:
>> Then don't interpolate it beforehand.  (Didn't you get a warning
>> about "use of uninitialized value"?)
>I can't use strict because I simple add a config-file via require and 
>the variables are simply declared (without my or our). And as it gives 
>me a lot of warnings, I disabled them, too :-)
>But I can't change the way it is, I just have to extend it.

You've confused use strict with -w.  Use of an undef value triggers a
warning under -w or use warnings.  Nothing to do with use strict.
If you require a file from a script that uses -w then warnings will be
enabled for that file due to the global nature of -w.
However, if you 'use warnings' instead, that pragma is lexically
scoped (like use strict) and therefore will *not* extend to any file
that is required from the one containing use warnings/strict.
One of the advantages of using the more modern approach to enabling
warnings.  (I spent a whole chapter going over strict and warnings
in Perl Medic because of their importance.)  So put 'use warnings'
at the top of your program.  Ditto with 'use strict'.  They won't
complain about problems in files you require, only about problems
in your own program, which therefore you can fix.

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to