How can I make Strawberry Perl's cpan(1) find perl? - perl

I'm having trouble installing Template module with Strawberry Perl.
cpan Template
yields the following:
Writing Makefile for AppConfig
C:strawberryperlbinperl.exe: not found
dmake.EXE: Error code 255, while making 'blib\lib\.exists'`
I haven't been able to understand either
how to affect the path so dmake will work correctly
why the path (which is correct) does not have any \ in it.

If you've been using MKS, you not only need to be sure you've removed it from your PATH, but you also need to ensure you don't have SHELL set to point to the MKS sh.exe.
I removed it from my PATH, and continued to struggle with this for a couple of more days until I realized dmake was invoking the wrong shell.
Hope this helps someone else down the road.

The answer was I needed to uninstall (or at least remove from my path) the MKSTookit (basically a unix shell environment for Windows like Cygwin.) Not exactly sure why this fixed the problem - but it has cleared things up and I am able to install via CPAN.
Thanks for everybody's answers and comments.

You've probably been bit by escaping. Somewhere something is configured with the path C:\strawberryperl\bin\perl.exe, but those slashes need to be escaped to:
C:\\strawberryperl\\bin\\perl.exe
Not knowing more about how you installed your perl, I can't tell you where this bad config value is likely to be found.

Related

PAR installation in perl cannot be completed

I desperately need your help! I need to compile a perl script to an executable so that it can be run in windows without having perl installed. I know it is not a good idea to do this , but I absolutely need it for the users of my script.
I have searched (a lot!) and decided the best solution is to use PAR::Packer. Yet I have been trying to install for something like 10 days now with no success… 
I ve tried all possible combinations of perl installation (activestate, strawberry, 5.10, 5.14, 5.16) and PAR versions, but I haven’t found the combination that really works….
I tried this link: http://www.nicholassolutions.com/tutorials/perl-PAR.htm
And this: http://www.rabbibob.com/index.php/PAR_Compiling_Perl_scripts_into_executables#Can.27t_find_par_loader
And various from this site..
Anyway, right now, I have installed (with the above instructions):
Strawberry perl 5.16.3001
PAR-1.007
The error I get now when I try to run
pp –o script.exe script.pl
is that:
pp is not recognized as an external or internal command, operable program or batch file
indeed I don’t find the relevant pp.bat in the bin. For earlier versions of par, this bat was created, although there other missing files were appearing when
running pp….
My path variable contains:
C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin
I also used PAR::Packer 1.0.14 but I get errors in the installation, something like
dmake.EXE: Error code 255, while making 'subdirs'
So, my question is: does anyone know a sure way this can work?? I am really frustrated and really pressed, every help will be deeply appreciated.
Thanks a lot!
I have used PAR to pack some scripts for other users. This has worked very well.
My old setup was done long ago. I have a new laptop and I tried to reproduce you error - but it seems like it just works.
My steps:
downloaded and installed strawberry-perl-5.18.1.1-64bit.msi
Install PAR::Packer with the cpan client
Create a testscript and type
pp -c -o test.exe test.pl
This produce the file test.exe - and it works fine.
the executable file pp is located in C:\strawberry\perl\site\bin\pp and was installed when i installed PAR::Packer.
If you cant find pp on you system you might want to check you installation of PAR::Packer.
I hope this helps :)

postgresql autodoc

I want to generate a ER Diagram sort of, of my spatial database i created inside of Postgresql. As i am also new to Postgresql, i am not too sure if the diagramming functionality can be done using whats offered by the PgAdmin (not referring to the Graphical Query Builder). However, it seems to me there is none. I read around that there is a perl based tool called postgresql_autodoc that can run through PostgreSQL system tables and return HTML, Dot, Dia and DocBook XML which describes the database. Now this is not exactly what i wanted but its the closest option i have. So i have successfully installed, ActivePerl 5.8 and DBD-Pg 2.10.0 for Perl 5.8 (DBD PG is a Perl DBI driver for the PostgreSQL database) and i have also downloaded the postgresql_autodoc.pl file. I have also added the path for Perl. But when i try to run the postgresql_autodoc.pl via the command prompt, i was getting this error: Possible Unintended Interpolation of #TEMPLATE in string at C:/Perl/bin/postgresql_autodoc.pl line 1831. Global symbol "#TEMPLATE" requires explicit package name at C:/Perl/bin/postgresql_autodoc.pl line 1831. Execution of C:/Perl/bin/postgresql_autodoc.pl aborted due to compilation errors.
I tried to view the postgresql_autodoc.pl using notepad++ however i have no experience with the perl language and so i cant figure out what is really wrong. All i could do is locate line 1831 but i dont know what i should do to fix this problem.
The postgresql_autodoc.pl file was downloaded from: http://www.rbt.ca/autodoc/
I would appreciate if anyone can help me here!
Thanks in advance
Barbara
That thingy, ##TEMPLATE-DIR##, is a string that is replaced when you build and install the module -- meaning you're not supposed to run it directly from the unpacked archive.
Most Perl modules are installed with a more or less simple three-step installation process, something like perl Makefile.PL ; make ; make install. However, this package is slightly different, you seem only to need make install.
Note that I have no experience with installing Perl modules on Windows with ActiveState. So the above may not work (e.g. if there's no make utility which is usually not part of Perl -- though it might be part of the ActiveState Perl distribution).
But there's a workaround. You can simply do what the install script does and replace the ##TEMPLATE-DIR## string yourself. It can be done easily with any text editor by replacing the two occurrences of ##TEMPLATE-DIR## with the path to where the postgresql_autodoc.pl script has been unpacked to -- meaning it's the path the script will look for the *.tmpl files in.
Note that Windows path names can be written with forward slashes in Perl, meaning C:/Temp/postgresql_autodoc should be OK.

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.

How do I configure Strawberry Perl to run from something other than c:\strawberry?

I know that Strawberry Perl portable is out there for Perl 5.10.0, but so far, there is not one for Perl 5.10.1. As a result, I'm currently doing some experimental work in getting Strawberry Perl to run from a networked location, just to see what I can get working. I've been able to fake some of it, enough to get some Perl and some tools running, but I've not been able to figure out how to move the vendor\lib folder away from c:\strawberry. I'm pretty sure my faking efforts will be for naught unless I know more about how these paths are set up.
Further reading:
Changing Perl Config Settings (PerlMonks)
Note: I have no idea, really.
Here is some speculation anyway:
Looking at Perl::Dist::Strawberry:
# Set the different paths
$machine->add_dimension('drive');
$machine->add_option('drive',
image_dir => 'C:\strawberry',
);
So, I imagine that would be the way to build whole distributions from source to be installed in a specific location.
Neither the executables, nor the dlls have the string strawberry in them, so my guess is hacking away at Config.pm and Config_heavy.pl would probably get things done.

Why can't Perl's Class::XSAccessor find Array.so?

This is my first post and I am hoping someone can point me in the right direction. I have tried Google but am not coming up with anything; actually, there are hardly getting any hits so I assume this is going to be a pretty obscure error.
I am trying to run a perl application (squeezecenter-7.3.3) on Solaris 10 and get the following error:
"ld.so.1: perl: fatal: relocation error: file /opt/squeezecenter-7.3.3/CPAN/arch/5.10.0/i86pc-solaris/auto/Class/XSAccessor/Array/Array.so: symbol get_next_arrayindex: referenced symbol not found"
ld.so.1 is in the search path, but I can't figure out what—ld.so.1 or Array.so—is causing the error. Any help will be appreciated.
Thanks
LATE UPDATE 2009-12-04
The current version of Class::XSAccessor contains both Class::XSAccessor itself and Class::XSAccessor::Array. It does not use AutoXS.pm to generate AutoXS.h any more but ships a static copy. Therefore, the problem giving rise to the question shouldn't occur (ever) again.
While Chris Simmons' idea is a good one, this is most certainly not the problem you're having. It is most likely an incompatibility between the version of Class::XSAccessor::Array you're using and the AutoXS::Header version it was compiled with.
A practically guaranteed* fix would be to reinstall Class::XSAccessor from CPAN. It should pick up a compatible version of AutoXS::Header. Maybe you should also post on the SlimDevices/Logitech forum about this.
On a more general note, as the author of both modules in question, I'm not sure why this problem is occurring at all. The dependency on version 1.02 of AutoXS::Header is part of the most recent Class::XSAccessor::Array release. Therefore, if dependencies are met correctly, everything should be fine. It may be some peculiarity of how the SqueezeCenter folks update their bundled modules. If not, feel free to get them in touch with me.
*The one problem remaining may be that the Class::XSAccessor::Array that comes with SqueezeCenter is prefered over the one you installed from CPAN (potentially into the system). In that case, you can try to install it into your /opt/squeezecenter.../CPAN directory.
Reinstall the offending module. Run this as root:
cpan -i Class::XSAccessor::Array Class::XSAccessor
Or manually install it.