Unable to load HMAC_SHA1 plugin - perl

Running the Twitter Application in Perl and facing the above mentioned problem. The Perl is 5.8.8 and system is AIX with no root access.
Code
./p_t.pl
Error
Unable to load HMAC_SHA1 plugin at
/vv/mm/tt/perl5/lib/perl5/Net/Twitter/Lite.pm line 192
Hwoever
cpan Digest::HMAC_SHA1
is running fine.
O/P
Digest::HMAC_SHA1 is up to date (1.03).
and SHA1 is not running properly
cpan
force install Digest::SHA1
Running make test Can't test without successful make Running make
install Make had returned bad status, install seems impossible
Failed during this command: GAAS/Digest-SHA1-2.13.tar.gz
: make NO

I realize this is an ancient post, but it's high on google, so this advice may eventually reach someone who can use it.
I was fighting with a similar issue, and it turned out my perl distribution did not include integer.pm (part of the distro) and I fixed said bug.
To check if this, or something similar, causes problems in your case, run this script:
#!/usr/bin/env perl
use Digest::HMAC_SHA1;
And check what it fails on.

Related

Problems installing "autovivification" module in Strawberry Perl

I have Strawberry Perl installed on my Windows 10 computer. I have been able to successfully install a number of CPAN modules, but I am getting stuck on the
autovivification
module.
It hangs on the make test part of the installation and I have to force it to quit. If I then try to run a program that uses no autovivification it fails with an error that it can't find the module in #INC which makes sense because it didn't install correctly.
I'm really not sure what to do next. Has anyone else had the same problem with installing this module on Strawberry Perl? What can be done about it?
Well, I'm not sure that this is really the best solution, but I think I just found a workaround for this problem. I simply skipped the make test part of the installation by opening the cpan shell, then doing: "notest install autovivification". That skipped the testing, so it wouldn't hang and it seemed to finish installing the module OK. I briefly tested the package to see if it loaded, and it seems to have, but there's a chance that something could still be wrong. I'll update this post if I encounter a problem...

Why does a packed Perl script not work on a different machine?

I have been trying to compile a script that was written in perl by someone other than myself into an executable format that can be used without having perl installed. There seems to be some sort of issue with Crypt::SSLeay packaging but I'm not sure what the error means. Here is a screenshot of the error message.
I've tried using PAR pp and cava to package, both will create executables that run just fine on the machine I'm using that has perl, but whenever I transfer it to a different computer I get the error seen in the screenshot. It's been the same error each time after changing compiler settings, and I'm not sure what to do at this point. If I have left anything out that may assist in answer please let me know and I will be happy to provide, coding is not my field so I am still learning and this is my first encounter with Perl.
First off, you probably do not need and should not use Crypt::SSLeay. However, both the modern Net::SSLeay and Crypt::SSLeay require OpenSSL binaries to be installed on the machine to run.
both will create executables that run just fine on the machine I'm using that has perl, but whenever I transfer it to a different computer I get the error ...
That's because the target machine does not have OpenSSL installed in the same location on which compiled the modules you are bundling.

Import/Export errors with morbo when using Mango

I'm working on a fresh Ubuntu vm, I've imported Mojolicious, Mango and MongoDB all through terminal (apt-gets and curls) but when I try and run any project that implements Mango - using command:
morbo project/script/project
It returns the following error:
Couldn't load application from file "project/script/project": "dumper" is not exported by the Mojo::Util module
Can't continue after import errors at /etc/perl/Mango.pm line 10
BEGIN failed--compilation aborted at /etc/perl/Mango.pm line 10.
Compilation failed in require at /home/user/project/script/../lib/project.pm line 3.
BEGIN failed--compilation aborted at /home/user/project/script/../lib/project.pm line 3.
Compilation failed in require at (eval 94) line 1.
The Mojo::Util and Mango.pm are all unedited dependencies as downloaded.
Never had any of these problems getting it to run on windows so I'm a bit lost where to start looking for a solution now.
Does anyone know what might be causing this?
Much the same as with other languages such as python or ruby, using system perl is a bad idea and will cause you headaches down the track. What will also cause you problems (much like this one) is pulling down packages "via curl" and simply unpacking to a directory. You need to install most things properly, and there are tools to manage both of these problems.
For instance, the underlying MongoDB driver module requires a C compiler to build as part of it's install process.
You may have installed that one via apt-get. But it is not recommended.
I would recommend using an "environment based" installation such as plenv or perlbrew in order to "manage" your installed perl installation, and not "mess around" with the system installed perl.
In either case, both will integrate well with the excellent cpanminus module and utility. This allows you to install packages from CPAN in a correct way, so that your application works and you avoid errors.
All options allow methods so you can install the modules locally for your application in this way. plenv may be better for you if you need "per application" separation on the same machine in this way.
Use the correct methods, and you are far less likely to run into problems.

Repeated failure when trying to write the Makefile for perl module during install

I'm trying to install some perl modules as part of the set up for Circos. I'm installing the modules using cpan in terminal, and while the initial set up seems to go well, all the modules fail during the final step of the install, when the Makefile is being written.
Here's what the error looks like:
Checking if your kit is complete...
Looks good
Writing Makefile for Font::TTF
Can't exec "make": No such file or directory at /System/Library/Perl/5.12/CPAN/Distribution.pm line 2026.
MHOSKEN/Font-TTF-1.02.tar.gz
make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
MHOSKEN/Font-TTF-1.02.tar.gz : make NO
I think the only option might be to manually install the modules instead of using cpan, but I figured it might be worth a shot to put up a question here.
It seems that /System/Library/Perl/5.12/CPAN/Distribution.pm is trying to find your system's "make" command. Since you're using Mac OS/X is "make" actually installed or do you need to add some developer tools?
To further on G. Cito's answer/question:
This old answer might do the trick for you, if you're on Mac OS/X, as the exact same error is thrown in the respective circumstances:
https://stackoverflow.com/a/6767528/2352071

Compiling WWW::Curl on ActivePerl

I'm trying (desperately) to build / install the newest version of WWW::Curl onto my activeperl box (I'll explain in a moment why I don't use the PPM)
I had to make some modifications as per the instructions found here:
http://cpansearch.perl.org/src/SZBALINT/WWW-Curl-4.15/README.Win32
I also had to change the following line:
From:
open(H_IN, "-|" "gcc", "$curl_h") and $has_cpp++;
To:
open(H_IN, "gcc $curl_h") and $has_cpp++;
I finally got perl Makefile.PL to work but now, when I run nmake, I get the following:
Missing right curly or square bracket at -e line 1, at end of line
Execution of -e aborted due to compilation errors.
NMAKE: fatal error U1077: 'C;|windows\system32\cmd.exe' : return code '0xff'
Stop.
Now, the reason I'm trying to compile this rather than using the PPM supplied by u.winnipeg is because the that PPM doesn't seem to support SSL transaction (I get "libcurl: ssl disabled") Now, if anyone can show me how to get ssl to run on this PPM, I'm more than happy to use it.
Thank you very much in advance
I presume the original was
open(H_IN, "-|", "gcc", "$curl_h")
The reason you have to change that in because noone got around to implementing feature in Windows. Change it to
open(H_IN, qq{gcc "$curl_h" |})
Use the right name and syntax for your compiler.
Well, I finally figured it out, thanks to everyone who responded. There were a bunch of things I had to change.
Using http://cpansearch.perl.org/src/SZBALINT/WWW-Curl-4.15/README.Win32 as a guide:
The open cmd as I did above worked fine. However, I did use the advice returned by ikegami, reinierpost, and mob.
Using nmake /n (as advised by socket puppet), it printed out all of the perl statements which were being executed. I took this output and placed it into a .bat file and corrected the perl syntax.
I changed all instances of
pm_to_blib({{#ARGV}
to
pm_to_blib({#ARGV}
(it is disturbing these were returned)
Then, I had to link the libcurl libraries to each line instantiating g++, which were not linked correctly. After I added these references, everything else went smoothly.
These were added:
C:\lc\curl\lib\libcurl.a C:\lc\curl\lib\libcurldll.a
Now, WWW::Curl is happily running on my system.
As for using the PPM version, it is exactly because of SSL I had to upgrade. The newest version of WWW::Curl is 4.15 the ppm version is (I believe) 3.02.
First, many people don't know that you can use ppm to install MinGW to use cpan to install modules.
Second, if the libcurl provided by your module doesn't do SSL, you can try and replace it with a suitable SSL version from the download page. This might well fail, but you might also be lucky.