in reply to Getting message property from outlook mail item

You need to read more about the objects you're using. For eaxmple,
my $Item = $client_folder->Items;
should be
foreach my $Item (in $client_folder->Items) {

in is imported using use Win32::OLE qw( in );

Update: According to Errto,

my $Item = $client_folder->Items; my $last_email = $Item->GetLast();

is functionally correct, but would be more accurate as

my $Items = $client_folder->Items; my $last_email = $Items->GetLast();

or simply

my $last_email = $client_folder->Items->GetLast();

Replies are listed 'Best First'.
Re^2: Getting message property from outlook mail item
by Errto (Vicar) on Jan 25, 2006 at 17:31 UTC
    According to MSDN, GetLast is a method of the Items collection itself so there should be no need to use in. Granted the OP is asking for trouble by calling the Items collection $Item but from what I can see there's no problem in the code.
Re^2: Getting message property from outlook mail item
by Win (Acolyte) on Jan 25, 2006 at 17:26 UTC
    I don't understand that bit. How does it all work - the importation bit I mean?

      Replace
      use Win32::OLE;
      with
      use Win32::OLE qw( in );
      and you'll have access to the in function.