The log says:
:info:build Can't load '/opt/local/lib/perl5/vendor_perl/5.26/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle' for module Cwd: dlopen(/opt/local/lib/perl5/vendor_perl/5.26/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle, 1): no suitable image found. Did find:
:info:build /opt/local/lib/perl5/vendor_perl/5.26/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle: mach-o, but wrong architecture
:info:build /opt/local/lib/perl5/vendor_perl/5.26/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle: mach-o, but wrong architecture at /opt/local/lib/perl5/5.26/XSLoader.pm line 99.
We can see that you're trying to build ossp-uuid for arm64. For what arch was /opt/local/lib/perl5/vendor_perl/5.26/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle built? To find out, run:
lipo -info /opt/local/lib/perl5/vendor_perl/5.26/darwin-thread-multi-2level/auto/Cwd/Cwd.bundle