package SysLog; $SysLog::Host = ""; $SysLog::Source = "SysLog"; $SysLog::Id = 1; $SysLog::Type = "i"; $SysLog::Description = ""; sub Write { use Win32::EventLog; ($SysLog::Type =~ /e/i) and ($SysLog::Type = EVENTLOG_ERROR_TYPE); ($SysLog::Type =~ /i/i) and ($SysLog::Type = EVENTLOG_INFORMATION_TYPE); ($SysLog::Type =~ /w/i) and ($SysLog::Type = EVENTLOG_WARNING_TYPE); %Event = ('EventID' => $SysLog::Id, 'EventType' => $SysLog::Type, 'Strings' => $SysLog::Description); Win32::EventLog::Open($EventObj, $SysLog::Source, $SysLog::Host) || return(FALSE); $EventObj->Report(\%Event); return(TRUE); } =POD =BEGIN PerlCtrl %TypeLib = ( PackageName => 'SysLog', TypeLibGUID => '{A3325260-2A29-11D2-AED0-00608C84AD4D}', # do NOT edit this line ControlGUID => '{A3325261-2A29-11D2-AED0-00608C84AD4D}', # do NOT edit this line either DispInterfaceIID=> '{A3325262-2A29-11D2-AED0-00608C84AD4D}', # or this one ControlName => 'SysLog Control', ControlVer => 1, # increment if new object with same ProgID # create new GUIDs as well ProgID => 'SysLog', DefaultMethod => 'Write', Methods => { 'Write' => { RetType => VT_BOOL, TotalParams => 0, NumOptionalParams => 0, ParamList => [] } }, # end of 'Methods' Properties => { 'Host' => { Type => VT_BSTR, ReadOnly => 0 }, 'Source' => { Type => VT_BSTR, ReadOnly => 0 }, 'Id' => { Type => VT_I2, ReadOnly => 0 }, 'Type' => { Type => VT_BSTR, ReadOnly => 0 }, 'Description' => { Type => VT_BSTR, ReadOnly => 0 } }, # end of 'Properties' ); # end of %TypeLib =END PerlCtrl =cut