Hello Perl Monks, I have a problem here; i use notes api's inorder to access certain properties of documents in lotus notes. As given in the code below, GetItemValue("PostedDate") is expected to return the value of the PostedDate field in the document. GetItemValue() function returns an array.
#!/usr/bin/perl use Win32::OLE; $server = $ARGV[0]; my $notes_dead = Win32::OLE->new('Notes.NotesSession') or die "Cannot +open Notes Session, $!"; print "The notes_server is : $server \n"; my $database_dead = $notes_dead->GetDatabase( $server,'mail\\admin.nsf +' ); my $view_dead = $database_dead->GetView('$Inbox'); my $ndoc_dead = $view_dead->GetFirstDocument; while ( $ndoc_dead ) { $nDocCount +=1; my $sub = $ndoc_dead->GetFirstItem("Subject"); my $deadlocation = $sub->text; #print $ndoc_dead->GetFirstItem("PostedDate"); my @Postdate = $ndoc_dead->GetItemValue("PostedDate"); print @Postdate , "\n"; foreach $i (@Postdate) { print @$i , "\n"; } $ndoc_dead = $view_dead->GetNextDocument($ndoc_dead); }
The value is collected in a variable @Postdate, printing only @Postdate returns a values like this ARRAY(0x422f2d8. In order to dereference it i tried to access every item in the array and used @$i; on printing this the value that got printed is Win32::OLE::Variant=SCALAR(0x422f4b8). Another observation that was made is this was seen only in case where the return value is in date format. if in place of PostedDate, Subject field was specified which is a string, i was able to print the value of subject field correctly using the same program. Please let me know if i am missing out on something. Thanks, Nisha

In reply to Problem with references by nisha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.