ActivePerl and PPM - perl

I have installed ActivePerl 5.14.2 on a Windows 32 bit machine running XP. My problem is that I'm trying to install a few modules with PPM and it's not working out.
According to ActiveState's website, all you need to do to install a module from their repository is "ppm install module name" , example: http://code.activestate.com/ppm/Template-Toolkit/
Every time I try this or any other module I get: "No Perl script found in input"
Even when I do just "ppm" I get the same message, even though the GUI should run.
When I run PPM with a GUI from the start menu I get this error: "Failed 500 Can't connect to ppm4.activestate.com:8080 (connect: timeout)”
I though that it might be my connection, so using cmd.exe I used the set HTTP_PROXY command and then tried ppm install, but still no luck. So is there any way I can get these modules installed?
Any advice is appreciated !!

Invoke the cpan prompt from your command prompt. Go to cmd and simply type cpan. If you successfully enter cpan prompt them there is probably no issues with your Perl installation. To install a module from cpan prompt just use
cpan>install Module::Name
Screenshot below shows command to install module Net::Stomp
If the above does not work, check if your FTP data and connection ports needs to be added to the Windows firewall exceptions (Ports 20 (FTP Command port) and 21 (FTP Data port)).
Alternatively (if you don't want to add port 20 21 to exception), you can go to the cpan prompt and use an ftp_proxy by
cpan> o conf ftp_proxy http://your.ftpproxy.com
and then issue install command. Or you can update your ../CPAN/config.pm file to make permanent changes to the ftp_proxy parameter.
The next step would be to try set the FTP_PASSIVE mode to 1. By default the libnetcfg configuration for this is set to 0. To change this find libnetcfg.bat file (should be somewhere C:\Perl\bin), open the file in an editor and replace
ftp_int_passive 0
to
ftp_int_passive 1
Again, looking at you r timeout error it seems that your network is blocking you from accessing the CPAN ftp mirrors, this would happen mostly if you are inside a corporate VPN. The solution to this can only be proxy servers.

Related

Can't install CYGWIN as windows service

I've installed CYGWIN on my windows server,
And now I'm trying to run it as a service so it will be running on every system startup, This is the command I tried but I get the error:
C:\cygwin64\bin>C:\cygwin64\bin\cygrunsrv.exe -I CYGWIN_SSHD -path C:\cygwin64\b
in\cygstart.exe
/usr/bin/cygrunsrv: Trailing commandline arguments not allowed
Try `/usr/bin/cygrunsrv --help' for more information.
Can anyone tell me what am I doing wrong?
I figured it out, To install Cygwin as a service I needed to run "ssh-host-config" insert all the needed definitions and this will install it as a service called "CYGWIN sshd".

Perl Network Drive Installation

I need to be able to run a few simple Perl scripts off of an NTFS (win server 2003 R2) drive. Is there any way to install Perl on this network drive (Strawberry or ActiveState, Strawberry preferred for built in cpan module compiler) and be able to run the scripts with whatever real time mounting on machines that do not have have/need a Perl distribution installed?
So far not having much luck with any relevant documentation.
Yes, we do this all the time.
Install Perl on your fileshare. I prefer to do this from the Windows Server hosting the fileshare, but I don't think it's necessary. If you don't have Remote Desktop and Admin access to that server, you'll need 2 PC's, 1 for the install and 1 to test this out. You can't test this on the same PC/server that ran the install.
Run this Windows Registry script on the test PC:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.pl]
#="Perl Script"
[HKEY_CLASSES_ROOT\Perl Script]
#="Perl Script"
[HKEY_CLASSES_ROOT\Perl Script\DefaultIcon]
#="C:\\WINDOWS\\system32\\Icons\\ActivePerl.ico,0"
[HKEY_CLASSES_ROOT\Perl Script\shell]
#="Open"
[HKEY_CLASSES_ROOT\Perl Script\shell\Open]
#="Open"
[HKEY_CLASSES_ROOT\Perl Script\shell\Open\command]
#="\"Z:\\network-folder\\Perl\\bin\\perl.exe\" \"%1\" %*"
[HKEY_CLASSES_ROOT\Perl Script\shellex]
[HKEY_CLASSES_ROOT\Perl Script\shellex\DropHandler]
#="{86C86720-42A0-1069-A2E8-08002B30309D}"
You will need to change this:
"C:\\WINDOWS\\system32\\Icons\\ActivePerl.ico,0"
to a path (preferably on the PC, not the network!) of an icon to go with the .PL files. You can drop those 2 lines from the reg script if you don't want a custom icon.
More importantly, you will need to change this:
"Z:\\network-folder\\Perl\\bin\\perl.exe\"
to the path where you installed Perl.
The DropHandler portion of that script is explained in more detailed in this other post: How do I create drag-and-drop Strawberry Perl programs?
Hope that helps!

Perl's DBD::mysql -- installation conflict

Attempting to install the Perl module DBD::mysql on Windows 7
From the Windows command line I executed
perl -MCPAN -e 'install DBD::mysql'
Which downloaded and uncompressed the file -- then gave me this ERROR:
CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.018.tar.gz
Set up gcc environment - 3.4.5 (mingw-vista special r3)
C:\PROGRA~1\MySQL\MYSQLS~1.1\bin\MYSQLA~1.EXE: connect to server at 'localhost'
failed
error: 'Access denied for user 'ODBC'#'localhost' (using password: NO)'
Problem running C:\PROGRA~1\MySQL\MYSQLS~1.1\bin\MYSQLA~1.EXE - aborting ...
Warning: No success on command[C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site
]
Guessing the issue is that MySQL's root user has a password, but what's not clear is how I resolve the issue.
Questions, feedback, requests -- just comment, thanks!!
----------
UPDATE (1): RE: force install DBD::mysql
cpan> force install DBD::mysql
Running install for module 'DBD::mysql'
Running make for C/CA/CAPTTOFU/DBD-mysql-4.018.tar.gz
Has already been unwrapped into directory C:\Perl\cpan\build\DBD-mysql-4.018-A
1T8Uh
'C:\Perl\bin\perl.exe Makefile.PL INSTALLDIRS=site' returned status 256, won't
make
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
On other platforms, the build process runs the mysql_config command to get necessary information about the mysql installation without need of a user and password; on win32, if you have a mysql_config command, you have to explicitly tell Makefile.PL about it with a --mysql_config yourpathname parameter. If you don't, it looks for the mysqladmin program and uses its location to determine as much as it can but runs mysqladmin version to get the mysql version. You can provide a user/password for it to be able to do this using --testuser and --testpassword parameters to Makefile.PL.
Following up on "Robert P" comment, I checked the install guide for installing DBD::MySQL in ActivePerl on Win32; on 64, but doesn't appear to have mattered.
Command that did the job was:
ppm install DBD::mysql
The only way I've got round this in the past is a forced install. It always feels like a bodge but I haven't been able to find a better way.
Open up a CPAN shell:
perl -MCPAN -e 'shell'
Then do a force install
force install DBD::mysql
quit gets you back out of the shell.
as ysth said , maybe try this :
cd C:\Perl\cpan\build\DBD-mysql-4.018-A
and run
perl Makefile.PL --testuser validuser --testpassword validpassword
and then try to make - make test - make install,
or its equivalents on windows

swlist command to get software installed on different system

When you run swlist with no arguments on an HPUX system you get the packages that are installed on that particular host. I want that same output but instead listing packages that are installed on a different system.
Is this possible?
find $(perl -e 'print"#INC"') -name \*.pm
will get you most of the way there.
Try using Net::SSH::Expect to execute the swlist command on the remote host, grab the output and do what you want with it. That's what I would do.

Alternative module of Net::SSH::Expect or how to connect remote server and get the output of command

I want to use Net::SSH::Expect in my unix box but unfortunately, it is not available and I am not able to convince the admin to install any perl module. Do you know how could I connect to a remote server using expect.
I know that I can archive that by using python but python is also not avai in my unix box.
Second attempt: though I use expect and shell scripting but the output is missing which is my original problem :Missing output when running system command
Please advise me any alternative module of Net::SSH::Expect so I can check its availibility in my unix box. Or any other way to connect remote server, execute some command and get the output ?
Million thanks.
You do not need your system administrator to install a module in order for you to run it. You can download and install it locally, and use local::lib to use it (as discussed in earlier questions on this site).
Alternatively, have you simply tried:
my $output = `ssh username#host command arguments`;