in reply to Re: Bareword issue with Perl 5.34
in thread Bareword issue with Perl 5.34
Thank you for your reply. I am starting to think that the issue is somewhere else. My .pl script should run both on macOS and on Windows. Obviously, when on it is run on macOS, the Win32::OLE should be skipped. I solved this like this:
use if $^O eq 'MSWin32', 'Win32::OLE'; if ( $^O eq 'MSWin32' ) { $Win32::OLE::CP = 'CP_UTF8'; }
Or compacter:
use if $^O eq 'MSWin32', 'Win32::OLE::CP' => 'CP_UTF8';On macOS the scripts load correctly and Win32::OLE stuff is skipped. If I use the same without '' or any of your suggestions, I get the Bareword "CP_UTF8" error. Am I everseeing something?
In Section
Seekers of Perl Wisdom