I'm moving to a new M1 Mac and am having a lot of trouble with certain Perl modules. They seem to be the ones that aren't pure Perl but are dependent on C libraries to run.
For instance, I installed Text::CSV to work on some CSV files. It seems to be installed correctly, as does Text::CSV_XS. But when I run a script that uses Text::CSV I get the following:
Can't load '/Library/Perl/5.30/darwin-thread-multi-2level/auto/Text/CSV_XS/CSV_XS.bundle' for module Text::CSV_XS: dlopen(/Library/Perl/5.30/darwin-thread-multi-2level/auto/Text/CSV_XS/CSV_XS.bundle, 1): no suitable image found. Did find:
/Library/Perl/5.30/darwin-thread-multi-2level/auto/Text/CSV_XS/CSV_XS.bundle: mach-o, but wrong architecture
/Library/Perl/5.30/darwin-thread-multi-2level/auto/Text/CSV_XS/CSV_XS.bundle: mach-o, but wrong architecture at /System/Library/Perl/5.30/XSLoader.pm line 96.
at /Library/Perl/5.30/darwin-thread-multi-2level/Text/CSV_XS.pm line 32.
Compilation failed in require at /Library/Perl/5.30/Parse/CSV.pm line 114.
BEGIN failed--compilation aborted at /Library/Perl/5.30/Parse/CSV.pm line 114.
Compilation failed in require at ia.pl line 3.
BEGIN failed--compilation aborted at ia.pl line 3.
Not sure if it matters, but I installed the module using cpanm in a terminal window that was running under the open using Rosetta option.
Text::CSV is just one example. I'm having similar issues with XML::LibXML, MARC::Record, and MARC::File::XML.
Any suggestions on how to get these modules working on my M1 Mac would be greatly appreciated.