I don't think strict does what you think it does. There's no need to pre-declare variables or functions (subs) in Perl. However, strict will complain about you using global variables without explicit package names. All you have to do is use lexically-scoped variables. It does this for very good reasons.
Or, in other words, when you first use a variable, use my:
my $xml = new XML::Simple;
When we advocate use strict;, we do so with good reason and as a result of vast experience. Personally -- I've been screwed over a few times because I was too lazy to work with strict in place. And vicariously -- we've all helped folks solve problems that would have been entirely avoided with the use of strict and warnings.
So please, use strict; use warnings; -- it really will help you learn good Perl more quickly!
In reply to Re^3: Accessing 2nd level elements in XML::Simple and using the data in an SNMP call
by radiantmatrix
in thread Accessing 2nd level elements in XML::Simple and using the data in an SNMP call
by wruehl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |