http://qs1969.pair.com?node_id=130035


in reply to Re: Re: Re: Coding for two platforms in one Script
in thread Coding for two platforms in one Script

I finally worked out what was causing the 'undefined variable' errors, and have resolved them.

The POD docs for Win32::EventLog imply that you can leave undefined variables which you don't want to use. This is true, from a functional perspective, but the module itself doesn't check that everything it's putting into a subroutine call is defined, hence the errors.

So the solution (for this module) is to either define the variables in the Report call properly, or set them to null/zero. I've also found that I need to set the machine name in the new() call, otherwise it also generates an undefined error.

You live and learn ;-)

Pete