I\'m an intern and very new to this...
My boss gets an email with two attachments every Monday which he has to turn into wiki code and put it on our internal website
You imported the in
subroutine from the package Win32::OLE
. It is probably some awful "syntactical sugar". And deeply unperlish. I suppose it returns some sort of list from the Win32::OLE
object $Folder
. So try this:
foreach my $msg (reverse $Folder->{items}->in)
or
foreach my $msg (reverse in($Folder->{items}))
Also, be sure to use strict
and use warnings
in every script to ensure high quality code. If you can be sure that a modern perl will be used, you can also use v5.10
and enjoy the say
function – it behaves like print
, but automatically appends a newline to your output.
Try something like this
foreach my $msg (reverse @{$Folder->{items}})
don't use "in" in perl