Writing Perl script

Lonny Selinger lonny at bangtherockstogether.net
Tue Apr 1 21:50:32 CEST 2003


One thing you can do is predeclare the variable as "undefined" oustide of any
functions. This is what I normally do when writing perl ... the alternative is to
declare it at the time of use (while using strict) in each function its called in.
An example of a pre-declaration might be:

my $var = undef;

Same goes for explicit declaration withing a function:

my $var = $some_var;

is this sort of what you're looking for? I'm assuming you're using strict.

--
Lonny


> Can some explain this for a perl newbi ?
>
> Explicitly initialize each varialable in use. Otherwise with caching enabled, the
> plugin will not be recompilied each time, and therefore Perl will not reinitialize
> all the variables. All old variable values will still be in effect.
>
> I think this is happening for me and i cant figuring out what to do about it.
>
> Thanks
>
> ---
> Gert





-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list