in reply to How do I convert VBA script to Perl? - Using Win32::OLE

I can't help you much — this is outside my area of expertise — but I see some problems.

In Inbox = $ns->GetDefaultFolder(olFolderInbox);, are you sure olFolderInbox is correct? Be sure to use use strict; and use warnings;.

if ($Inbox->Items->$Count = 0) {
should be
if ($Inbox->Items->Count = 0) {

foreach ($Inbox->Items) {
should be
foreach (in $Inbox->Items) {
Don't forget to import in:
use Win32::OLE qw( in );

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.