我試圖通過我的收件箱來搜索特定的電子郵件,但每次嘗試運行此腳本時都會出現$ search未初始化/未定義。語法有問題嗎?用Perl搜索Lotus筆記收件箱
use Win32::OLE;
use Win32::OLE::TypeInfo;
#Create a new NotesSession, which is basically like a new Lotus Notes instance
my $Notes = Win32::OLE->new('Notes.NotesSession') or die "Could not open Lotus Notes";
#Prints the current user of Lotus Notes
print "The current user is $Notes->{UserName}.\n";
#Gets the stuff in the listed Database
my $Database = $Notes->GetDatabase('Server', 'mail.nsf');
# Open the mail
$Database->OpenMail;
# Create a new Document, ie email
my $Document = $Database->CreateDocument;
# Send the email to someone
$Document->{SendTo} = ;
# CC the email to someone
$Document->{SendCc} = ;
# Subject of the email
$Document->{Subject} = 'Test';
my $date = $Notes->CreateDateTime("Today");
my $today = $date->DateOnly;
my $search = $Database->Search("@Tripwire",$today,5);
print $search->Count;
由於
什麼是語法?我試過$ Database-> Search(Subject =「@Tripwire」,$ today,5);但我得到一個錯誤。我應該使用變體嗎? – Shahab
在Lotusscript中,我會使用| Sendto =「@Tripwire」|作爲語法 –
perl呢? – Shahab