Am new to perl and its working under windows(using xampp 1.7.4 ).
Am trying to use perl to send email (using gmail smtp).The issue is that i seem to have successfully installed Net-SMTP-SSL with ppm so i was expecting it under c:\\xampp\perl\bin but it seems to have gone under 'c:\xampp\perl\site\lib'.
now when running my script i am getting this :
Can't locate Net/SMTP/SSL.pm in #INC (#INC contains: /usr/lib/perl5/5.10/i686-cy
gwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl
5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vend
or_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/l
ib/perl5/vendor_perl/5.8 .) at getbalanceWindows.pl line 5.
BEGIN failed--compilation aborted at getbalanceWindows.pl line 5.
That's because you're running it under Cygwin.
Using ActiveState ppm will make it available to cmd.exe, not Cygwin.
A couple of options here:
Use cmd.exe
Install Net::SMTP::SSL via cpan to make it available to Cygwin
$ cpan Net::SMTP::SSL
or
$ perl -MCPAN -e 'CPAN::Shell->install("Net::SMTP::SSL");'
Side Note
Does XAMPP necessitate the use of Cygwin? Methinks not, but I may be wrong.
Related
I'm having trouble with a Perl application that fails with an LibXSLT-related error on Mac OS Big Sur 11.4 on multiple computers (all Intel Macs) - it worked correctly before the Mac OS upgrade, and now seems to fail on a freshly installed up-to date Mac.
The error message for a minimal script perl -MXML::LibXSLT -E 'say $INC{"XML/LibXSLT.pm"}' (using system perl - no other perl is installed on the machine) is as follows:
Can't load '/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle' for module XML::LibXSLT: dlopen(/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle, 0x0001): symbol '_xsltLibxsltVersion' not found, expected in flat namespace by '/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/XML/LibXSLT/LibXSLT.bundle' at /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm line 197.
at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/XML/LibXSLT.pm line 48.
BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/XML/LibXSLT.pm line 48.
Compilation failed in require.
BEGIN failed--compilation aborted.
cpan -i XML::LibXSLT confirms that XML::LibXSLT is up to date (1.99).
I tried updating the xslt libraries with brew install libxslt but it did not seem to make any difference.
I've tried running brew link libxslt --force, which now does not do anything (Warning: Refusing to link macOS provided/shadowed software: libxslt).
Running cpan -f -t XML::LibXSLT fails with the following error message:
looking for -lxslt... no
libxslt not found
Try setting LIBS and INC values on the command line
If I set the LIBS and INC values to the path suggested by brew export LIBS="-L/usr/local/opt/libxslt/lib" and export INC="-I/usr/local/opt/libxslt/include", it still fails with this error.
Any suggestions on how to debug this? I'm not a Perl developer, just trying to run an existing app.
Perlbrew
Eventually, I succeeded with perlbrew instead of the default OS X system perl.
The following process worked, based on recommendations at https://perlbrew.pl :
curl -L https://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install perl-5.16.0
perlbrew switch perl-5.16.0
sudo cpan -i XML::LibXSLT
I consider it not as a proper solution but as a workaround - after all, there's no reason why the OS X preinstalled libxslt shouldn't just work with the preinstalled system perl - but it at least works.
I was using a bash script in my bashrc and until now everything worked.
Today, i decided to install Perl on my computer (since I'm looking to learn the language) using the method on the website learn.pearl
curl -L xrl.us/installperlnix | bash
(urls are not accepted )
The problem is that now, my script doesn't work anymore, I'm having the error:
"no such file
export PERLBREW_BASHRC_VERSION=0.78"
I tried to use the command "perlbrew switch-off" but it seems that I don't have the program perlbrew installed, and my bashrc is starting with #!/bin/bash so I'm completely lost on you to fix the problem.
I would appreciate some help.
Thanks !
Make sure that you got everything to download the perlbrew, like curl or wget, it is simple to check, try one of theses:
which curl
which wget
If you have one of them you are able to download, otherwise you will need to install either curl or wget.
The latest realease of perlbrew is 0.78.
After theses first steps try to download it again as you did.
There is a mini tutorial which you can use as a guide:
https://perlbrew.pl/
Also I am not sure if you have it installed so you could use:
which perlbrew
To find out if you have it or not. Maybe you forgot the step as describe in the perlbrew site:
sudo cpan App::perlbrew
perlbrew init
Because it seems like your environment was not set yet.
I have downloaded and installed Strawberry Perl on a Windows 2012 R2 server to run Bugzilla. I have everything installed and configured fine, and Bugzilla is running, but I have a requirement to use LDAP integration. So I tried to install the Net::LDAP module using perl install-module Net::LDAP, but it fails to install because it needs GSSAPI which requires krb5_config.
After working with the people at Bugzilla, I have installed the MIT Kerberos for Windows with the SDK, and ran perl install-module GSSAPI --shell to get to CPAN. Then I ran look GSSAPI so I could download everything and try making the file, but this is where it is failing. I can't figure out what command to run next. I tried MakeFile.pl --gssapi_inc as well as MakeFile.pl --gssapi_libs, but both give me this error:
run "perl Makefile.PL --help" to see further installation options if options gssapi_libs or gssapi_lddlflags are provided, then gssapi_inc must be as well at C:\STRAWB~1\cpan\build\GSSAPI-0.28-JPLEEE\Makefile.PL line 89.
I am now completely lost as to what I need to do to install the Net::LDAP module.
Note: I am using Strawberry Perl and not ActiveState perl so installing via PPM is not an option.
Second NOTE: I know this might be off topic for Stackoverflow but as it does relate to programming I thought it might fit here, if it is a better fit somewhere else please just flag to move.
Actually, Strawberry Perl does come with the PPM module installed, so you can use ppm to install modules. Personally, I have never used ppm to install modules with Strawberry Perl.
To install a module, you just type 'cpan install [module]'. So for the Net::LDAP module, that command becomes: cpan install Net::LDAP
I just tried to install Net::LDAP using portable Strawberry Perl 5.22.1.2 32-bit on Windows 8 and it installed without any issues.
I do not have the MIT Kerberos installed, but I also tried to install the GSSAPI module and that failed. Part of the output from that attempt showed Linux paths. And the CPAN Testers matrix for that module does not show any tests done on Windows. It's possible that you don't really need to have that module installed and might not be able to install that module on Windows.
Here is my problem. I am running OS X v10.7 (Lion) and want to set up an old Perl program I have written (was then using a Windows System with ActivePerl and then its ppm).
I read to use CPAN to install Perl modules (I am trying to install the Graph module). Whenever I tried to install it, it failed from a refused connection. Why? So I read that I should run the following to update CPAN and fix any broken links:
cpan> install Bundle:CPAN
cpan> reload cpan
cpan> index cpan
cpan> exit
However, after doing this I am stuck with this every time I try to do a CPAN install or upgrade:
New CPAN.pm version (v1.9800) available.
[Currently running version is v1.9456]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
I was trying to use the default Perl stuff that is included in OS X rather than downloading ActivePerl. How do I fix CPAN and install the Graph Module?
PS: Running install CPAN and reload CPAN didn't do anything, but it generated the same message.
UPDATE
I was able to upgrade to v1.9800 doing a manual install (make, install) through the terminal. But I am still unable to install the Graph Module. Here is what I am getting:
http://cloud.jjnford.com/3D1C1H4217222b1p1O3a
UPDATE - PROBLEM SOLVED
I was finally able to solve the problem. I just moved the /User/jj/.cpan directory to User/jj/.cpan_bak and then reconfigured CPAN and the Graph Module installed with no fuss.
To solve this problem, do a manual upgrade of CPAN (apparently on OS X CPAN has trouble upgrading itself). You can download the source from here. After you have downloaded it uncompress it, create the make file from the Perl script, then run a make test, and finally if all goes well a make install.
$> tar -xvxf CPAN-1.9800
$> cd CPAN-1.9800
$> perl Makefile.PL
$> make
$> make test
$> make install
Now get rid of your old CPAN configuration:
$> mv ~/.cpan ~/.cpan.bak
Now when you run CPAN from the terminal you should be prompted for the configuration again. Once this is complete and CPAN has started you will notice this:
cpan shell -- CPAN exploration and modules installation (v1.9800)
So CPAN is now upgraded and working, and in my case I installed the Graph Module:
$cpan> install Graph
And everything works fine. I hope this helps somebody.
I have a fresh Mac OS X Lion and I updated CPAN without problems.
Installing XCode is not enough. Make, gcc, g++ are not installed by default.
To install them, one has to:
Start XCode, go to XCode->Preferences->Downloads and install component named "Command Line Tools".
I know this was solved, but do consider using "cpanminus" instead next time. It's faster and could save you a lot of hassle. You can either install App:cpanminus using cpanminus (see: App::cpanminus):
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
And then to install any module and its dependencies simply run:
cpanm <module>
Alternatively you could use it directly from the web:
curl -L http://cpanmin.us | perl - --sudo <module>
I use it on my OS X Lion, and it works perfectly :)
Please excuse me for replying to this old post.
I had the same issue as the OP. Once I corrected the command to contain two colons instead of one (i.e. - Bundle::CPAN vs Bundle:CPAN), it worked as expected.
Until now I used ActiveState's ActivePerl, and used the ppm for installing modules.
Last week I moved to Strawberry Perl, but I don't know how I should install modules using Strawberry Perl. What is some information on how module installation is done using Strawberry Perl or is there some link on how to install new modules?
You can still use ppm, but it is not recommended. Run CPAN client from the Strawberry Perl or Strawberry Perl (64-bit), sub folder Tools, entry in the Start menu.
Type install Module::Name there.
As Alexandr says, you can use the CPAN client via the start menu. You can also install modules just as you would on Unix from the DOS window:
perl -MCPAN -e shell
install Quantum::Entanglement
You can also download the .tar.gz from CPAN, unzip it and install as you would in Unix:
cd Module-Name-1.23
perl Makefile.PL
dmake
dmake test
dmake install
You may need to make sure your %PATH% environment variable has the right entry to get to Strawberry Perl, and does not contain other copies of dmake or gcc, which will sometimes lead to headaches.
Change the directory:
cd C:\Strawberry\perl\bin
Then
C:\Strawberry\perl\bin>cpan Lingua::EN::Sentence
and the module will install automatically.
CPAN is the easiest installation method.
As Alex has noted, you may have to download a .tar.gz and unzip it. Since he wrote his answer, Strawberry Perl has deprecated dmake, and you should use gmake instead.