Personally, I have historically been opting for ActiveState in most cases, but I recommend you try them both and make up your own mind. Larry Wall, the creator of the Perl language, uses Strawberry Perl on Windows - which might be construed as a strong endorsement!
You can find some more information about Perl on Windows here at perl.org.Note that you might get issues about missing DLL files being used by some modules, such as vcr70.dll, ssleay32.dll, etc. If your script's modules use DLL files, you must still find a way to bundle/install the DLL files. Packaging it in an MSI file (Microsoft Installer) is probably most convenient, but to my knowledge there aren't too many free MSI editors (if any?).
So putting Perl on a network share can be very useful. In a way it's like having Perl installed on every client in a domain, since you can use Perl in startup scripts, logon scripts or whatever you might need it for. This need for "portability" kept me using Perl for a good long while because I needed something that I could guarantee the client had - and I've never been a fan of VBScript. I've been using Perl for Windows systems administration tasks for years. With Windows 7 came native PowerShell support, but many still have XP clients to support. With WSUS, Zenworks and similar products you can "push" PowerShell and .NET, so it is likely to be adopted by more people in the future - and must probably be considered commonly available these days (February 2012).Sometimes I have needed to send people working executables and PAR is a handy way of packaging a Perl executable. Read more about packaging a Perl executable here.
CPAN is probably the most significant advantage for Perl developers.
As of late summer (northern hemisphere) 2011 there are almost 100,000 pre-written Perl modules, by well over 9000 different authors on CPAN. Some of these represent a lot of work, and the modules are free to be reused easily. Installing them is also simple, either using tools that download and compile packages from CPAN directly or with PPM (Perl Package Manager) which installs precompiled binaries.>ppm install Module::Name >cpan -i Module::Name
>cpan -i Module::Name
First, you might be used to setting the %PAGER% environment variable in Windows XP, but I'm having some issues with this on Windows 7.
When I now set the %PAGER% variable, or $env:PAGER as it is in PowerShell, I'm seeing this error, and the pager isn't being used:C:\>perldoc -v $] 'less.exe' is not recognized as an internal or external command, operable program or batch file.
You can set it in the GUI (system properties, advanced, environment variables). You have to log off and back on for system environment variables to take effect. This doesn't seem to be useful in Windows 7 though.
So I decided to write a little wrapper function. Now, this was a bit harder than I initially thought, due to some parameter parsing stuff in PowerShell. The easiest thing to do might just be "perldoc -f stat | less", as in piping manually to less.exe, which you put in a path directory.PS C:\> perldoc perlop | less
Below is the "perldok" function I wrote. Put it in your PowerShell profile (external Microsoft site link) so it's run automatically when you start PowerShell.
function perldok { param([Parameter(Mandatory=$true)][string[]] $Doc, [switch] $f, [switch] $q, [switch] $v) # Too bad I can't use the switch statement. if ($f) { perldoc -f $Doc | less.exe } elseif ($q) { perldoc -q $Doc | less.exe } elseif ($v) { perldoc -v $Doc | less.exe } else { perldoc $Doc | less.exe } }
As you can see, I only added support for the parameters I use most commonly myself, namely: -f, -q and -v, and simply a doc name if none of those are specified. If you want to use other perldoc parameters, you will need to use perldoc (not perldo'''k''') and pipe to less manually - or customize the function.
The obvious advantages of using less.exe are being able to move both up and down with the arrow keys or the "Page up" and "Page down" keys. You can also search by entering a slash, "/", and then the search term (followed by enter of course). To jump to the next search hit, press "n" (presumably a mnemonic for "next").NB! Press "q" (for "quit") to exit less.exe.
See this article: Self-contained batch file with Perl code for information on how to put a Perl script in a batch/cmd file that can be run from PowerShell or cmd.exe, and it contains the Perl code within itself.
The TheoryX repository has many useful modules.
To add the TheoryX ppm repo for ActivePerl for Perl 5.8.x, use this command:ppm repo add TheoryX http://theoryx5.uwinnipeg.ca/ppms/package.xmlTo add the Theoryx ppm repo for ActivePerl 5.10.x, use this command:
ppm repo add TheoryX http://cpan.uwinnipeg.ca/PPMPackages/10xx/To add the TheoryX ppm repo for ActivePerl 5.12.x, use this command:
ppm repo add Theoryx http://cpan.uwinnipeg.ca/PPMPackages/12xx/To add the Theoryx ppm repo for ActivePerl 5.14.x, use this command:
ppm repo add Theoryx http://cpan.uwinnipeg.ca/PPMPackages/14xx/
Minimum cookies is the standard setting. This website uses Google Analytics and Google Ads, and these products may set cookies. By continuing to use this website, you accept this.