best way to compile a perl script for macintosh? (os x) - perl

I see that on stack overflow, there is discussion about compiling perl for Unix and Windows machines that don't have a perl interpreter installed.
i.e. Compiling a perl script to a .exe
I'm wondering what to do for Mac? Would I need to compile it and make it run on my own OSX system before I send it to someone else? Is perl just the wrong language for this in general?

I'm use Perl Dev Kit (PDK) for this. It's not free but with PerlApp tool I can create executables for many platforms.

Related

How to run perl or shell scripts in windows in secured environment without strawberry perl or Cygwin

I need to write perl or shell scripts in windows environment for automation. Please suggest some freeware.
For perl I tried padre perl but post installation it requires connection with CPAN which my proxy doesn't allows.Hence its unable to identify modules once I run perl scripts.
Also for running Shell scripts I tried cygwin but its unable to identify loop statements while running shell scripts.
How should I go ahead?
Thanks in advance!
Why you don't use Activestate? I think is the best perl packaged system for Windows.
Here's the link for the free community edition:
http://www.activestate.com/activeperl/downloads
As for editors, you can also use Komod Edit: http://komodoide.com/komodo-edit/

Vim plugin does not recognize existing Perl support

I've been using the CoqIDE plugin for Vim on Linux machines for editing Coq files. Now I'm trying to install it on Windows 8. But when I try to source the plugin, I get
Your vim doesn't support Perl. Install it before using CoqIDE mode.
which is strange, because with :version I clearly see +perl/dyn included. Is this different from the +perl that I need?
I heard somewhere that you need to have Perl installed before Vim to get a Perl-enabled Vim, so I tried that as well. I uninstalled Vim, installed Strawberry Perl 5.18.2.2 (64bit), and reinstalled Vim. Still the same problem.
If the solution involves manually compiling binaries, I would really appreciate detailed instructions as I don't have any experience with it.
+perl/dyn just specifies that Vim has been compiled with dynamic Perl support; it doesn't yet check that the Perl library can be loaded successfully. To do that, try executing a Perl command, e.g.:
:perl VIM::Msg("Hello")
This probably yields on your system:
E370: Could not load library perl510.dll
Sorry, this command is disabled: the Perl library could not be loaded.
Next, you'd then have to investigate whether a proper Perl version has been installed and the DLL is accessible (though the PATH).
Download DWIMPerl for windows. I'm running win7 64 and gvim 7.4.2. Using strawberryperl and activeperl resulted in :echo has('perl') to yield 0. By switching to DWIMPerl (and ensuring my PATH env variables are proper) :echo has('perl') now yields 1 using the standard gvim distribution. This is important for vim extensions like dbext which require proper support for perl interfaces.

MinGW or Cygwin GCC?

I want to install a GCC compiler in Windows for the Eclipse IDE. I know there are two options: MinGW GCC or Cygwin GCC. Which one is better for Eclipse CDT? Any experience or suggestions will be appreciated.
Using Cygwin means your program will be dependent on cygwin1.dll, which is essentially a layer that allows POSIX functionality to be used in a Windows environment. Compiling with the standard MinGW GCC provides no such dependancy. This means however, if you intend to compile with MinGW GCC, you will not have access to POSIX functions such as fork() and exec().
For more information on the differences between Cygwin and MinGW, see here.
My offhand thoughts are, if you need cygwin, you need it. For instance compiling programs that were developed for Unix and have symbolic links and shell scripts in the build system.
If you don't need it, you don't want it. And compiling under linux on a virtual machine is often a better choice than going the cygwin route.
So mingw is perfectly fine. Works fine, simple to use.
Also: You might consider codelite (www.codelite.org) instead of Eclipse.
Personally I like Cygwin better, it has a lot of installation options and it feels a lot like the terminal you'll find on a Linux machine. It provides a pretty substantial set of Linux-like capabilities, something that Windows fails at miserably.
Cygwin and Mingw are not interchangeable alternatives. Cygwin is used to compile POSIX API programs, Mingw is used compile Windows API programs.
Chose one or the other depending on what kind program you're going to write.
Wikipedia Says:
MinGW forked from version 1.3.3 of Cygwin. Although both Cygwin and MinGW can be used to port UNIX software to Windows, they have different approaches: Cygwin aims to provide a complete POSIX layer that provides emulations of several system calls and libraries that exist on Linux, UNIX, and the BSD variants. The POSIX layer runs on top of Windows, sacrificing performance where necessary for compatibility. Accordingly, this approach requires Windows programs written with Cygwin to run on top of a copylefted compatibility library that must be distributed with the program, along with the program's source code. MinGW aims to provide native functionality and performance via direct Windows API calls. Unlike Cygwin, MinGW does not require a compatibility layer DLL and thus programs do not need to be distributed with source code.
Because MinGW is dependent upon Windows API calls, it cannot provide a full POSIX API; it is unable to compile some UNIX applications that can be compiled with Cygwin. Specifically, this applies to applications that require POSIX functionality like fork(), mmap() or ioctl() and those that expect to be run in a POSIX environment. Applications written using a cross-platform library that has itself been ported to MinGW, such as SDL, wxWidgets, Qt, or GTK+, will usually compile as easily in MinGW as they would in Cygwin.
The combination of MinGW and MSYS provides a small, self-contained environment that can be loaded onto removable media without leaving entries in the registry or files on the computer. Cygwin Portable provides a similar feature. By providing more functionality, Cygwin becomes more complicated to install and maintain.
It is also possible to cross-compile Windows applications with MinGW-GCC under POSIX systems. This means that developers do not need a Windows installation with MSYS to compile software that will run on Windows without Cygwin.

Compile native Windows executable from perl source on linux

I have a perl script on a linux system that I would like to compile to generate an executable that runs natively on Windows. I would like to do this with free software, preferably Perl PAR / pp. Is this possible?
You need to run pp on a windows machine to make a windows binary. I know it works, I've done it. Any Linux specific code will need to be made at least platform-independent or windows specific, but Perl is a generally platform independent language. Using File::Spec will help.

Is it possible with Padre to run and debug Perl scripts with a different Perl version?

Padre is a (open) IDE for Perl that does look promising.
Since Padre is written in Perl itself, it is not apparent whether it's easily possible and practicable to run and debug Perl scripts in this IDE that are running on a different Perl version than the IDE itself.
As an example, say I download the current installer (for Windows) which will install and run Padre on Strawberry Perl 5.12 -- can I then use this IDE to run+debug my scripts that are running on ActiveState Perl 5.8.9? (Yes, and I want them to run exactly on AS+5.8.9 because this is where they'll run in production.)
I am aware that there is a Padre package for AS+5.8.9 but I would much rather install the default IDE package and have the IDE run on the Perl it normally runs on and have my scripts run on the Perl they normally run on.
Insights?
Under Tools->Preferences->Language - Perl 5 you can specify the perl binary as well as its parameters to run your projects.