{"id":214,"date":"2010-04-07T22:46:16","date_gmt":"2010-04-07T22:46:16","guid":{"rendered":"http:\/\/www.michaelm.info\/blog\/?p=214"},"modified":"2010-04-07T22:46:16","modified_gmt":"2010-04-07T22:46:16","slug":"mailscanner-perl-issue-with-the-xs-version","status":"publish","type":"post","link":"http:\/\/www.michaelm.info\/blog\/?p=214","title":{"rendered":"MailScanner Perl issue &#8211; &#8220;with the XS version&#8221;"},"content":{"rendered":"<p>Well I am trying to upgrade MailScanner on one of my servers. Alas, these upgrades\u00a0are never straight forward. The MailScanner upgrade went reasonably smoothly but when it came to starting MailScanner the problem showed itself. Starting MailScanner resulted in the following error:<\/p>\n<pre><a href=\"mailto:root@smlon01:\/opt\/MailScanner\/bin\">root@host:\/opt\/MailScanner\/bin<\/a># .\/MailScanner\n\u00a0is only avaliable with the XS version at \/usr\/local\/share\/perl\/5.8.7\/Compress\/Zlib.pm line 9\nBEGIN failed--compilation aborted at \/usr\/local\/share\/perl\/5.8.7\/Compress\/Zlib.pm line 9.\nCompilation failed in require at \/opt\/MailScanner\/lib\/MailScanner\/SA.pm line 42.\nBEGIN failed--compilation aborted at \/opt\/MailScanner\/lib\/MailScanner\/SA.pm line 42.\nCompilation failed in require at .\/MailScanner.orig line 110.\nBEGIN failed--compilation aborted at .\/MailScanner.orig line 110.\n<a href=\"mailto:root@smlon01:\/opt\/MailScanner\/bin\">root@host:\/opt\/MailScanner\/bin<\/a>#<\/pre>\n<p>The root of the error is the message about &#8220;is only avaliable with the XS version&#8221; within Compress\/Zlib.pm line 9. There are a few posts relating to this but no real resolutions. One of the common suggestions, which works for a few people it seems, is to force reinstall the Scalar::Util Perl module. Use &#8220;force install Scalar::Util&#8221; from within the CPAN shell. This didn&#8217;t work for me.<\/p>\n<p>I tried a short test script to try reproduce the problem:<\/p>\n<pre>use Scalar::Util qw(dualvar);\nuse Compress::Zlib;<\/pre>\n<pre>print \"$Scalar::Util::VERSIONn\";\nmy $foo = dualvar 10, \"Hello\";\nprint \"$foon\";<\/pre>\n<p>This worked which indicates that the XS functionality is working properly.<\/p>\n<p>I figured it might be related to the load order of the libraries. For MailScanner 4.79.11-1 I managed to work around this problem by inserting<\/p>\n<pre>use Scalar::Util qw(dualvar);<\/pre>\n<p>in at line 38 (just after &#8220;require 5.005;&#8221;). This appears to load the Scalar::Util XS functions before MailScanner alters the library search paths.<\/p>\n<p>Hopefully this helps someone else with this problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well I am trying to upgrade MailScanner on one of my servers. Alas, these upgrades\u00a0are never straight forward. The MailScanner upgrade went reasonably smoothly but when it came to starting MailScanner the problem showed itself. Starting MailScanner resulted in the following error: root@host:\/opt\/MailScanner\/bin# .\/MailScanner \u00a0is only avaliable with the XS version at \/usr\/local\/share\/perl\/5.8.7\/Compress\/Zlib.pm line 9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[35,59,61,70,90],"class_list":["post-214","post","type-post","status-publish","format-standard","hentry","category-technical","tag-error","tag-library","tag-mailscanner","tag-perl","tag-upgrade"],"_links":{"self":[{"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=214"}],"version-history":[{"count":0,"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/214\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=214"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.michaelm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}