anselmomh has asked for the wisdom of the Perl Monks concerning the following question:
where LogInit and LogIT are functions inside CLUILogger.pm Inside CLUILogger.pm i have the following codemylog = LogInit('LSEUI', 'UI', $thisloglevel); LogIT($mylog, '1', 'INFO', 'STARTUP', '', 'LSEUI Starting...User="'.$usercheck . '"' );
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? -Mikepackage 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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE objects
by crashtest (Curate) on May 06, 2005 at 19:37 UTC | |
by anselmomh (Initiate) on May 06, 2005 at 19:54 UTC | |
by crashtest (Curate) on May 06, 2005 at 21:05 UTC | |
|
Re: Win32::OLE objects
by chromatic (Archbishop) on May 06, 2005 at 19:22 UTC | |
by anselmomh (Initiate) on May 06, 2005 at 19:29 UTC | |
|
Re: Win32::OLE objects
by jimbojones (Friar) on May 06, 2005 at 21:03 UTC | |
by anselmomh (Initiate) on May 06, 2005 at 22:29 UTC | |
|
Re: Win32::OLE objects
by jimbojones (Friar) on May 06, 2005 at 19:28 UTC | |
by anselmomh (Initiate) on May 06, 2005 at 19:37 UTC | |
by jimbojones (Friar) on May 06, 2005 at 19:43 UTC | |
by anselmomh (Initiate) on May 06, 2005 at 20:09 UTC |