Shawn H. Corey wrote: [..snip..]
> Here's an example of what they're talking about. Notice that when
> CONFIG_VAR is called, a new $new is created and set to zero. For it's
> second call and those that follow, the $num inside callback remains
> unchanged.
>
> sub CONFIG_VAR {
> my $num = 0;
> sub callback {
> return ++$num;
> }
> print "CONFIG_VAR: \$num = $num\n";
> }
[..snip..]
> Since this is the behaviour you want, the error message seems
> superfluous
I should have paid more attention to my output, and less attention to
the warning.
What I had originally (named sub with callback) was exactly what I
wanted, and the behaviour was desired. I guess I've hit a plateau
whereby I need to better understand some of Perl's 'warnings' triggers,
and figure out for myself whether the warnings are fatal to my program
or not.
Thanks Shawn for the help.
If anything, it's taught me to read my own output before I panic that
the warnings are telling me that I'm doing something I shouldn't be.
Steve
fwiw, no matter what, 'use warnings;' and 'use strict;' should ALWAYS be
in effect. If you have a question about warnings, it's better to ask
than it is to ignore them completely...
smime.p7s
Description: S/MIME Cryptographic Signature
