[Solved]: Perl Error – Undefined subroutine &Scalar::Util::blessed

Updated on September 2, 2017

I have been using OpenCA for managing a certificate authority and only to be shocked when it broke last night. All of a sudden, the OpenCA startup script failed with an error message as shown below.

Undefined subroutine &Scalar::Util::blessed called at /usr/lib/perl5/5.8.8/overload.pm line 89.
Compilation failed in require at ./openca_start line 62.

openca scalar:utils error

It seems like some perl package was broken. But why and how? Well, may be due to ‘yum update’ that might have updated one of the perl package (probably a wrong one or a corrupted one)?

Solution:

At first, it looked like the subroutine package Scalar::Util::blessed is missing, so tried installing it using CPAN,  unfortunately it led to an another error as below:

cpan> install Scalar::utils
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Mon, 25 Aug 2014 10:17:02 GMT
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Undefined subroutine &IO::Uncompress::Base::readonly called at /usr/lib/perl5/site_perl/5.8.8/IO/Uncompress/Base.pm line 1031.

So the next option was to install the subroutine IO::Uncompress::Base::readonly, but the same error popped up again!

Cpan disappointed me, but I don’t think source compilation will. So decided to install Scalar::Utils package from source. Download Scalar::Utils and compiled it as shown below:

[root@ca ~]# wget http://search.cpan.org/CPAN/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.45.tar.gz
[root@ca ~]# tar -xvf Scalar-List-Utils-1.45.tar.gz
[root@ca ~]# cd Scalar-List-Utils-1.45
[root@ca Scalar-List-Utils-1.45]# perl Makefile.PL
[root@ca Scalar-List-Utils-1.45]# make
[root@ca Scalar-List-Utils-1.45]# make install

Finally, restarted the OpenCA service and Voila, it worked.

Was this article helpful?

Related Articles

Comments Leave a Comment

  1. Same error message for netdisco, after a yum update – but installing Scalar::Utils from CPAN did not work for me… 🙁

Leave a Comment