in reply to Hash problem.
As far as the original error goes ("Can't use an undefined value as a HASH reference at line 49"), it looks like your problem is this:
$FullName = $Document->GetFirstItem('FullName')->{Text};
The call to $Document->GetFirstItem() must be returning an undefined value. Why it is doing that is for you to figure out...
Aside from that, I've just got a few general comments. Give the code below, which is a modified copy of what you originally had:
use strict; use Win32::OLE; use Data::Dumper; ### Skipped everything that worked... my ($FullName, $Extension); my $Notes = Win32::OLE->new('Notes.NotesSession)' or die "Can't start Notes session: $!"; ### (1) ### my $Database = $Notes->GetDatabase('GLOSPK2', 'iddnames.nsf'); my $AllDocuments = $Database->AllDocuments(); ### (2) ### my $Count = $AllDocuments->Count; ### (3) ### print "There are $DocCount documents in the database.\n"; ### (4) ### for ( my $Index = 1; $Index < $Count; $Index++ ) { # do stuff... }
I had these observations, suggestions, etc. All of them should be taken with a grain of salt, however, given that I've never done any Lotus Notes programming via Perl.
Finally, I'd recommend a closer look at your Notes documentation. I found an example in my Notes docs that "shows how you can use a While loop and GetNextDocument to access every document in a view". You may find that example enlightening.
p.s. -- get a PerlMonks account, log in, stick around... you'll like it here. :-)
|
|---|