Is anyone familiar with this problem? A Google search turns up some notes -- enough for me to verify things with a test -- but I'm not sure how to fix things.

The problem is this: When using modules that use Crypt::Random, I get errors like this:
"makerandom" is not exported by the Crypt::Random module at /usr/local +/lib/perl5 /site_perl/5.6.1/Crypt/Random/Generator.pm line 12 "makerandom_itv" is + not exported by the Crypt::Random module at /usr/local/lib/perl5/sit +e_perl/5.6.1/Crypt/Random/Generator.pm line 12 "makerandom_octet" is not exported by the Crypt::Random module at /usr +/local/lib/perl5/site_perl/5.6.1/Crypt/Random/Generator.pm line 12 Can't continue after import errors at /usr/local/lib/perl5/site_perl/5 +.6.1/Crypt/Random/Generator.pm line 12 BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/Crypt/Random/Generator.pm line 12, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.6.1/ +Crypt/Random.pm line 18, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/Crypt/Random.pm line 18, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.6.1/ +Crypt/DH.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/Crypt/DH.pm line 6, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.6.1/ +Net/SSH/Perl/Kex/DH1.pm line 13, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/Net/SSH/Perl/Kex/DH1.pm line 13, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.6.1/ +Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1. Compilation failed in require at usr/local/lib/perl5/site_perl/5.6.1/N +et/SSH/Perl/SSH2.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.6.1/ +Net/SSH/Perl.pm line 51, <GEN0> line 1.

I get this trying to use Net::SSH::Perl. I can reproduce it with this code:

use strict; use Net::SSH::Perl; use UNIVERSAL; # <-- THIS LINE CAUSES THE PROBLEM my $host = 'XXXXXXX'; my %opts = (port => 22, debug => 1, protocol => 2); my $ssh = Net::SSH::Perl->new($host, %opts);
My own code doesn't include that use UNIVERSAL line but if I search what I've installed from CPAN I find a lot of modules that do. If I take that line out, the errors disappear. That seems to be the source of the problem. But I have not found a fix referenced anywhere -- I can't remove all the ones in the CPAN modules I found. Even if I did, I wouldn't be able to upgrade without checking every one I download. This seems like something other monks should have hit somewhere along the line ...

This is Perl 5.6.1 on a Solaris 2.8 platform. I did some limited testing on a 5.8 Perl platform (also Solaris 2.8) and got the same thing. Any help appreciated.


In reply to Crypt::Random makerandom exports and UNIVERSAL.pm by steves

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.