Ok i have a perl program LSEUI.pl and a Module for logging called CLUILogger.pm.
inside the LSEUI.pl i have the following code
mylog = LogInit('LSEUI', 'UI', $thisloglevel);
LogIT($mylog, '1', 'INFO', 'STARTUP', '',
'LSEUI Starting...User="'.$usercheck . '"'
);
where LogInit and LogIT are functions inside CLUILogger.pm
Inside CLUILogger.pm i have the following code
package CLUILogger;
use Win32::OLE;
use Exporter;
@ISA = qw(Exporter);
@EXPORT=qw(LogIT);
#Example Logline with all things described
#LogIT($mylog,
# '5(loglevel def 5)',
# 'INFO(category info/error/etc)',
# 'TESTING(function)',
# 'TESTING2(blank or further action inside function)',
# "This is my logged line");
sub LogInit{
my $appname = $_[0];
my $module = $_[1];
my $apploglevel = $_[2];
$LogObj = Win32::OLE->new('LOGGERHELPER.UILogHelp');
$Log0bj->{LogLevel} = $apploglevel;
$Log0bj->{AppName} = $appname;
$Log0bj->{Module} = $module;
Win32::MsgBox('my log is "'.$LogObj.'"');
return $LogObj;
}
sub LogIT {
my $LogObj = $_[0];
my $loglevel = $_[1];
my $category = $_[2];
my $activity = $_[3];
my $subactivity = $_[4];
my $logstring = $_[5];
if ($LogObj->{LogLevel} < $loglevel)
{
$LogObj->LogMessage($LogObj->{AppName},$category,$activity,$subactiv
+ity,$logstring);
}
}
1;
but when i run the program it tells me
Can't call method "LogMessage" on unblessed reference at /PerlApp/CLUILogger.pm line 25.
when the code was all inside the .pl file it worked fine its only when i pulled out the logging portion (so that all my programs can use it) that it started giving me this problem.
Any ideas what im doing wrong here?
-Mike