Can't locate Understand/license.pm in #INC Error - perl

I want to run my perl script which suppose to use the "Understand Scitool Perl API". I have included the statement "use Understand;" in the script have but when I tun the it on the terminal, it keeps showing me this error:
"Can't locate Understand/license.pm in #INC".
Does anyone know how can I install "Understand" module in order to be able to use its library knowing that I have already installed "Understand" tool.
Note: Im working on Mac operating system.

The SciTools Understand module requires a licence in the form of a license.pm file
If you're doing this at work then you should speak to your system administrator or manager to get hold of one. If you're working on your own then you need to talk to SciTools
Where did you get the main Understand module from?

Related

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.

Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML

I have downloaded strawberry PERL and writing one application with CGI Perl Apache on Winxp sp3).
One of the libraries (written by someone else) which I using uses XML::LibXML. When i load the page it gives Internal Server Error. From Apache error log i can see this error:
Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 190.
C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll exists with all permissions.
Also this library works properly on Linux. My application also works fine if I remove all code that needs LibXML.
Can anyone tell me when can be possible issue here.
If you peek into the source for DynaLoader you'll find
Many dynamic extension loading problems will appear to come from
this section of code: XYZ failed at line 123 of DynaLoader.pm.
Often these errors are actually occurring in the initialisation
C code of the extension XS file. Perl reports the error as being
in this perl code simply because this was the last perl code
it executed.
You should have also gotten (but may not have noticed) the following dialog, which provides a more accurate error message:
The problem isn't that perl can't find LibXML.dll; it's that LibXML.dll can't find the real libxml. (The former is just a wrapper that provides Perl bindings for the latter.) To fix that you need to ensure that Strawberry Perl's c\bin folder is in your PATH. In your case, that would be C:\strawberry\c\bin.
You might have to check the environment variable settings in the windows,
make sure that the installation path of the module is present in the PATH variable.
The reason it works in linux is that make files usually set the environment variables for you in linux in windows it may not have set properly.
For eg;
go to Control Panel\System and Security\System click change settings then advanced tab in user variable section see if there is a variable called perl5lib.
if not create an new perl5lib variable and add the path of your library ( usuall C:\Perl\site\lib but may be different in your case)
I had the same issue after installing Strawberry perl. It was working fine when I run the script from server, but not remotely from a automation tool. The issue was because of the Environment variables not updated when we run it remotely. So I did server reboot, which resolved the issue.
I encountered the same problem recently, in my case it was not related to PATH variable (it was already correct). The thing is I was executing my script from Git Bash console and as it turned out git-bash perl was being used instead of Strawberry (see git-bash perl should not be first in path). Switching to standard Windows CMD terminal helped.

Perl Module Installation

I am attempting to install a Perl Module entitled: File-Copy-Recursive and I am following these steps:
1) open cmd.exe
2) perl -MCPAN -e 'install File::Copy::Recursive;'
and I receive the message "It looks like you don't have a C compiler and make utility installed. Trying to install dmake and the MinGW gcc compiler using the Perl Package Manager. This may take a few minutes..."
"Downloading ActiveState Package Repository packlist...failed 500 Can't connect to ppm4.activestate.com:80 (connect: timeout).
Downloading File-Copy-Recursive packlist...not found
ppm.bat install failed: Can't find any package that provides MinGW"
These failed because I am behind a proxy, and I do know the proxy settings but I don't know how to apply them in this situation.
Is anyone aware of any alternative fixes to this solution?
Thank you.
It seems you are using ActiveState Perl, which comes with its own package manager (called PPM) to ease the pain of installing modules, especially those which would normally require a C compiler to be able to install.
Try following the instructions to set up your environment so that PPM knows about your proxy. For example, to set the proxy settings for a single instance of cmd.exe:
C:\>set http_proxy=http://username:password#proxy.example.org:8080
Then, in the same command prompt window, try this (it works for me, though I'm not behind a proxy):
C:\>ppm install File-Copy-Recursive
Note that it's probably a good idea (maybe even required?) to run cmd.exe "As Administrator" to make sure it has full authorization.
EDIT: The particular module you want to use is written in pure Perl. For a quick "installation", you can just download it from CPAN, extract the files, and copy the "Recursive.pm" file into a File\Copy directory structure placed in the same directory as your script:
yourscript.pl
File\
Copy\
Recursive.pm
As an alternative you could try the Strawberry Perl distribution which comes with tools for building XS modules.
Hi
I guess you are using Activestate Perl
look at
http://docs.activestate.com/activeperl/5.10/faq/ActivePerl-faq2.html#what_is_ppm
PPM is installed automatically with ActivePerl.
To use PPM, your computer must be connected to the internet, have access to a PPM repository on a local hard drive or network share, or have access to a mounted ActiveState ActiveDVD.
If you connect to the internet via firewall or proxy, you may need to set the http_proxy environment variable. See PPM, Proxies and Firewalls for more information.

Using Actinic V8 and having a problem with Path to Perl and Perl Script Extension

I am using Actinic v8 and having a problem locating the path to Perl. I am getting this message popping up and I just don't know what to do to solve it.
The wizard needs to know where Perl is installed on the web server and what extension Perl scripts must have in order to execute on the remote server. You may need to contact your ISP to gather this information. Be sure to specify the "." on the extension if it is required. For example, ".cgi", or ".pl".
It then gives you an option for 'Path to Perl' and 'Perl Script Extension'
Your ISP knows where and if perl is installed on your server and if the server is configured to require file extensions for CGI scripts. There is no way anyone else can tell for certain.

Why doesn't my Perl script find my module even after I adjust #INC with FindBin?

I want to be able to use a module kept in the lib directory of my source code repository, and I want the only prerequisite for a developer to use the scripts that I'm writing is to have a standard Perl installation, but I'm not sure how to accomplish this.
In my scripts, I have
use FindBin qw($Bin);
use lib "$Bin/lib"; # store non standard modules here
use Term::ANSIColor;
use Win32::Console::ANSI;
print Term::ANSIColor::colored("this should be in color\n", "bold red");
and I put the module in ./lib. I verified that's the actual location where the module exists (by renaming it and causing it to fail). However, even if the module is in an arbitrary lib directory, it still seems to be a requirement that ppm be aware of the module.
I can not get my scripts to find/use it in lib without it being "installed" by ppm first. I would imagine that there should be some sort of way around this.
I know this may be an atypical request, but my goals are probably atypical. I just want a developer to do a checkout and immediately use some scripts without having to run some additional commands or use a package manager.
Thanks for any insight.
EDIT: I updated with a complete example. I also realized that if I uninstall it via ppm (but leave the pm in the referenced directory), I may have to change my syntax, and I was not considering that before. So maybe I have to give a full path or use require like jheddings or BipedalShark propose (ie. if it's not "installed", then I must use "require" and append ".pm" to it or use a BEGIN block.
If this is the case, then I have not found the correct syntax.
EDIT 2: Based on a comment below, I realize that I may have a flawed assumption. My reasoning is this: If I reference the actual code, the ".pm", directly then I should be able to use it without using a package manager. Maybe that's not the case, or if I want to do that maybe I have to do it a different way. Alternatively, I may have to refactor the code in the ".pm".
EDIT 3: I think that I was misunderstanding a few things. The error message in my IDE "Compilation failed in require", it's highlighting of the line that I was using to include the module, and the console error message of "Can't locate loadable object for module Win32::Console::ANSI"
I was reading that as a problem with loading the module itself, but it seems to be a problem that results from something the module itself is attempting to load. Interesting that this is only a problem since I didn't use ppm install though.
It is finding the actual module. I was able to verify that by commenting out the trouble lines.
Thanks for the help, but I'll have to spend some more time with it.
See perldoc perldiag under "Can't locate loadable object for module ...":
(F) The module you loaded is trying to load an external library,
like for example, "foo.so" or "bar.dll", but the DynaLoader module
was unable to locate this library. See DynaLoader.
You are correct that this problem is arising from something the module is trying to load -- that's what Dynaloader does. However, the documentation for Win32::Console::ANSI makes no mention of any external library requirements.
Are you preserving your module path structure in your lib directory?
i.e. your module should be in the path $Bin/lib/Some/Module.pm.
From perlfaq8's answer to How do I add the directory my program lives in to the module/library search path?
You appear to be doing it correctly, but you need to give us more if you expect to get help.
When you run that script, what ends up in #INC? Put in a debugging line like:
BEGIN {
use lib ...;
print "INC is \#INC\n";
}
Check that that output shows the directory that you expect. If it doesn't, start bisecting the problem from there.
Try this:
BEGIN {
use FindBin qw($Bin);
}
use lib "$Bin/lib"; # store non standard modules here
I manually install modules all the time and it seems to work. I just copy directories and files into a location and use the "use lib" directive like you've shown. Sometimes I miss a file and I get a runtime error that it's looking for a certain file and I go find the file on the Internet and put it in the right place and it works. Not sure what's going on with your setup. This should work.
I usually put the perl modules in the same directory as my script and then: use lib "."
But I don't know that it would matter.