I have to create an exe from a Perl script. I installed
ActivePerl-5.14.2.1402-MSWin32-x86-295342.msi
How do I install pp?
I know this is a relatively old question, but for the sake of others, here is a solution that worked for me using pp (Par Packager):
Install Strawberry Perl for windows (I installed strawberry-perl-5.16.3.1-64bit.msi)
I used 5.16.3.1 because I wanted to try out perl2exe as well, while I'm at it (perl2exe at the time supported only up to 5.16.3 version of perl)
Once installed, open Strawberry Perl Tools (e.g. through start menu -> All programs -> Strawberry Perl -> Tools), and invoke CPAN Client
In the client console that opens, type:
get pp
install pp
Once installation is complete, you can simply run:
c:\strawberry\perl\site\bin\pp.bat -o myScript.exe myScript.pl
Which will produce a myScript.exe which is a standalone executable (no external perl interpreter is needed)
Note: You can use the -d command line switch in order to reduce the size of the executable. This will not include perl interpreter code inside the executable, reducing the size of the executable, however you will need to provide perl5x.dll in the same directory as your executable, or include it on the PATH environment variable.
Until the issue with 1.010 is fixed, do the following:
Go to http://search.cpan.org/dist/PAR-Packer/
From the "Other releases" drop down list, select PAR-Packer-1.009 and download it
Decompress the archive, preserving directory structure
Run perl Makefile.PL
Install all the missing prerequisites by hand using ppm. E.g., ppm install Module::ScanDeps etc
Install MingW: ppm install MingW
dmake, then dmake test, then dmake install
Later, you can remove PAR::Packer from the site area using the ppm GUI and install the fixed version.
This is a Perl module called PAR::Packer, so it can be installed as any Perl module with CPAN. Unfortunately, you're using ActivePerl which isn't quite compatible with CPAN. Instead, you can see if use ActiveState's Perl Package Manager to install this module.
If the module isn't available via the Perl Package Manger, you can try installing with the CPAN command line utility. Open up a Console Window (Start->Accessories->Command Prompt) and type in cpan and press <ENTER>. Newer versions of ActiveState should automatically install the required compilers, etc. when you first start to use CPAN.
I prefer Strawberry Perl for Windows because it's more compatible with CPAN. However, ActivePerl has a lot of the Win32 modules already installed. Plus, it comes with the Perl Package Manager which is nice.
WARNING: ActiveState installs a lot of these Perl scripts not in C:\Perl\bin, but in C:\Perl\Site\bin which means you have to make sure that directory is in your path too.
As of v1.010, the software cannot be automatically packaged, see the report at Trouchelle's repo.
Install CPAN using PPM, then continue as per the Stack Overflow Perl FAQ: What's the easiest way to install a missing Perl module?
ppm install MinGW
cpanp i Win32::Exe PAR::Packer
In addition to the above answers,
You can use cpan to install the PAR::Packer.
From your windows command prompt use the command: cpan install PAR::Packer.
Note: I have Strawberry perl installed.
cpan installs the modules and the dependencies as well.
Related
I am using perl version 5.16.3. I have installed PadWalker using this:
sudo apt-get install libpadwalker-perl
After restarting eclipse when I started debugging I am still getting the error:
Error displaying local variables
Install PadWalker & restart Eclipse or disable displaying of local variables
Can anybody help?
Thanks,
Sumit
You have two builds of Perl installed:
/usr/bin/perl (the "system" perl)
/home/demo/perl5/perlbrew/perls/perl-5.16.3/bin/perl
apt-get install libpadwalker-perl installs the package for the system Perl.
I'm assuming you've configured EPIC to use the other, and this is the one that needs PadWalker. Run
perlbrew use 5.16.3
cpan PadWalker
or
/home/demo/perl5/perlbrew/perls/perl-5.16.3/bin/cpan PadWalker
I want to use perlbrew and cpanm on my machine. I installed perlbrew like this
curl -L http://install.perlbrew.pl | bash
and sourced ~/perl5/perlbrew/etc/bashrc in my .bashrc. Next I installed perl v5.21.5 and switched to this version.The which perl command points to my perlbrew installation. The same is true for cpanm.
But when I install a perl module like cpanm Mojo Neither the binaries are installed nor the includes can be located. But all tests pass. I looked under ~/perl5/ and could not find the sources. Does anyone had the same issue before? I may have used cpan on my Ubuntu 14.04 before. May this cause any problems? How can I figure out where cpanm put the module?
BTW: I'm using perlbrew version 0.71
I solved the problem by deleting everything perl-related in my home directory. The folder ~/.cpan had write-proteced files. Only the sudo user could delete them. I assume I used cpan as root in the past. In addition I deleted ~/.cpanm and ~/perl5. After reinstalling perlbrew, perl and mojolicious, everything worked out of the box.
In my case I was just trying to get some perl code running. Many thanks to the #perl channel on irc.freenode.net.
I first used local::lib but may not have fully cleaned up after using it. The modules I needed for the code I was trying to get running would not run with the system perl. It was just too old.
Then I tried perlbrew install perl-5.20.1 and perlbrew install-cpanm. It felt great to start fresh with a known quantity. Yet I found that modules were passing tests and said they were installing but not getting found and used. Dependencies were trying to be continuously reinstalled. Installing the dependencies one at a time didn't even work. It was baffling. Somewhere along the way I read to set PERL_MB_OPT and PERL_MM_OPT though I think I should have also set PERL5LIB with those.
So I started over with perlbrew after rm -rf ~/.cpan ~/.cpanm ~/perl5. Everything just works now. Hurray!
Are you running the cpanm command in a new terminal window by chance, if so it might not use the new perl you brewed.
"perlbrew use" only makes the current shell use the brewed perl whereas "perlbrew switch" makes all new shells of the current user use the selected perl.
You should provide the output of "perl -V" and "perlbrew info"
Here is a tip how you can find where cpanm installed a module:
1) install locate (sudo aptitude install locate)
2) run "sudo updatedb" (creates the index used by locate)
3) run "locate Mojo" to see where the files have been created.
Also interesting would be to know which cpanm binary you are using. "which cpanm"
You can install a perlbrew-wide cpanm with "perlbrew install-cpanm"
[ I'm going to assume you started a fresh shell (e.g. reopened your terminal or executed exec bash) or sourced ~/perl5/perlbrew/etc/bashrc in your current shell after installing perlbrew ]
Which Perl did you use to install cpanm? cpanm will install modules for the Perl that runs it, which will be the one mentioned on the first line of cpanm if you run it as cpanm ....
Options:
Use cpan instead of cpanm.
Install cpanm using your newly installed Perl.
Use perl -S cpanm ... as a workaround.
We are running a CentOS Linux server, on which Perl 5.8.8 is installed. We cannot update Perl on this system.
I am installing Eclipse with EPIC to do some Perl coding onto my Windows 7 workstation. This requires that I install Perl on the workstation as well. I've installed a few different versions of Perl and they all have issues for us... Our code makes use of the Switch and Expect commands.
Strawberry Perl 5.8.8.4 has Switch.pm, but not Expect.pm.
DWIM Perl 5.14.2.1 does has Switch.pm, but can't locate it. It also doesn't have Expect.pm.
ActivePerl 5.16.3.1604 has Switch.pm, but can't locate it. It also doesn't have Expect.pm.
Can someone recommend a Perl that I can install on my workstation that will provide these modules? Alternately, is there a way to install these modules?
Try this with strawberry perl:
perl -MCPAN -e 'install Expect'
This is somewhat answered by Expect - Can I use this module with ActivePerl on Windows?
Up to now, the answer was 'No', but this has changed.
You still cannot use ActivePerl, but if you use the Cygwin environment (http://sources.redhat.com), which brings its own perl, and have the latest IO::Tty (v0.05 or later) installed, it should work (feedback appreciated).
I installed perl5.14 via macports.
By typing
which perl
I get
/usr/bin/perl
How do I change the perl to point the macports one.
My .profile is:
# MacPorts Installer addition on 2012-02-02_at_14:42:32: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
Maybe the perl port isn't active? try:
$ sudo port activate perl5
sudo port install perl5 +perl5_14
You need to re-launch terminal for the export to take effect. As a quick but messy workaround you can always invoke perl like this:
/opt/local/bin/perl Remember to put that in your Perl scripts as well. Also, unlike unix I find I always have to use sudo when installing to a local directory.
Macports is great for installing all those non-Perl libraries that aren't installed on the Mac, however it is not so great for installing Perl modules as it is dependant on there being a port of it, you can't really use CPAN to install. perlbrew does work on the Mac and is a much better solution. But if you still want to use Macports to install non-Perl libraries you hit a problem. I solved it with a .profile like this:
source ~/perl5/perlbrew/etc/bashrc
# export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Note the comment. The first line gives me my perlbrew Perl when I open terminal. When I want to use Macports to install libraries I swap the comment around and re-launch terminal and I then have Macports Perl. Of course this means I need two Perls on my machine, and they both need to be the same version but I don't have any problems with this.
Not being on a Mac, I cannot answer your exact question. However, many Perl users/developers now use perlbrew to install newer versions of Perl and manage choosing between them. I am fairly confident that it works on Mac. Read more at the website or CPAN.
So... I have been trying to get this working for several weeks now. I can install MinGW through the .exe, but no-matter what I do I can't seem to get make support or ppm install MinGW to work in such a way that my compilation of Tk-804.029 will correctly use the 'make' command.
(Installing a Perl Module:
perl MakeFile.PL - Works fine
make or dmake - I can't get MinGW to properly associate Make or DMake (Can't find the correct .exe in the MinGW/bin directory either... I've tried using the -32bit mingw32-make.exe but that brings up errors to do with the compiled header files.
)
ppm install MinGW also doesn't work, seems to think it can't find the package. So I am at a loss. System is running Windows 7 on a x64 setup.
What perl are you using? You could try
perl Makefile.PL MAKE=dmake
or
ppm install http://www.bribes.org/perl/ppm/Tk.ppd
ppm install dmake MinGW
ppm upgrade dmake MinGW
or download from
http://ppm4.activestate.com/author/MINGW.html
Or try http://strawberryperl.com/
I'd suggest using Strawberry Perl if possible (and for Perl on Windows in general), as it will give you a working dmake out of the box. I don't have Windows 7, but Tk installs fine from CPAN using Strawberry 5.10 on Windows XP.