On my system, conf2struct depends on p5.28-conf-libconfig which does exist.
The conf2struct portfile does not mention a perl version explicitly; it just uses whatever value of perl5.major
is exported by the perl5 portgroup. That value is based on the variant of the perl5 port that you have installed, so you have likely installed the perl5 port with the +perl5_26 variant. To fix the problem, reinstall the perl5 port with the +perl5_28 variant. Since that is currently its default variant, you can accomplish this by just running sudo port install perl5
. This would probably be a good idea to do anyway since perl 5.26 is old. (Perl 5.28 is old too but it is still the default version used in MacPorts. Once MacPorts moves to a newer default version, the perl5 port should automatically upgrade to that new variant for you when you upgrade ports, now that MacPorts distinguishes between variants you requested explicitly and variants which were merely selected by default.)
In fact the conf2struct port probably should mention a perl version (such as 5.28) specifically since the perl version does get baked into the files that conf2struct installs.