Hary has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have updated Microsoft word to new version and the word methods in the perl script no longer work. I am getting error "Bareword wdCharacter not allowed while strict subs in use". The perl script used to work fine with older version of word. Here is the code: $Word->Selection->Delete({Unit => wdCharacter, Count => 1}); Thanks.

Replies are listed 'Best First'.
Re: perl script for word
by LanX (Saint) on Aug 18, 2020 at 21:55 UTC
      I downloaded strawberry perl only. I have not used any modules. As mentioned the functions in the perl script "wdCharacter, wdPrintView, wdOutlineView" used to work fine with the old Word version but it does not work with the new Microsoft Word.

        Perl has no built in support for manipulating Microsoft word files, you are likely using Win32::OLE to automate Word, the object model may have changed between versions.