Re: New-to-Perl: recommendations for windows setup? (updated)
by davies (Prior) on Feb 16, 2021 at 12:06 UTC
|
Strawberry Perl works well. You are / your newcomer is likely to need some use of the command prompt to see STDOUT & STDERR & use the cpan[m] tool, but file associations can be set up automagically by the installation process (I'll accept corrections on this), meaning that double clicking on a .pl in the explorer will Just Work. Also, the path to Perl itself is automatically created as part of the install process, so it can be run from any directory. But the real question is the purpose. Are you going to be writing Perl for $newcomer to execute, or will $newcomer be writing Perl? My experience of WinPerl IDEs has left me unimpressed. Padre was written by our own szabgab and I know one person who swears by ActiveState's Komodo, but I prefer Notepad++ with a command prompt to execute the files as & when I wish. But then I LIKE text interfaces.
If you want a cheap Linux box & are prepared to settle for 4Gb of RAM, consider a Raspberry Pi. You will have to add the hard disc over USB, but it may well be way under your budget & is likely to be more fun. Again, purpose matters here.
Regards,
John Davies
Update: I see your interest in WSL suggestions. If you want a comparable variant & aren't scared of an old version, git comes with Perl 5.8.8 on Windows.
C:\Git\bin>.\perl.exe -v
This is perl, v5.8.8 built for msys
| [reply] [d/l] [select] |
|
Are you going to be writing Perl for $newcomer to execute, or will $newcomer be writing Perl? My experience of WinPerl IDEs has left me unimpressed.
I think both (and from a distance). So that's why an IDE sounds appealing as I will not be there. | [reply] [d/l] |
|
| [reply] [d/l] |
|
Strawberry Perl works well
For a long time I used Active State. When I has changed laptop I thought I'd give Strawberry Perl a go and I know that I prefer it although I'm not sure I can articulate why.
file associations can be set up automagically by the installation process (I'll accept corrections on this), meaning that double clicking on a .pl in the explorer will Just Work.
Totally correct. Except that the process opens in a command window which closes when the script ends. So, it is necessary to add a delay to the end of the script if you want to see any output. But it is not onerous to type perl script.pl at the command prompt.
If you want a cheap Linux box & are prepared to settle for 4Gb of RAM, consider a Raspberry Pi.
That was exactly what I first thought!
There is an 8Gb version. However, standard Raspberian is a 32 bit OS so cannot access more than 4Gb. There is a 64 bit version of the OS in beta form and it seems likely that a stable release will be along before too long.
| [reply] [d/l] |
|
Re^2: New-to-Perl: recommendations for windows setup? and the linked thread explain my transition but, like you, I used AS for a long time. The first or second London Raspberry Jam had a demo of RiscOS on the Pi and, since reading https://hothardware.com/news/raspberry-pi-microsoft-repository-phones-home-added-pi-os, I have been investigating alternatives to whatever the new official name for Raspbian now is. I understand that there is a "pure" Debian available and, if that allows 64 bit, I will be very interested, even though all the Pis I use are version 1 with 256 or 512Mb. There is certainly a Pi version of Ubuntu available, but https://www.theregister.com/2021/02/11/azure_ubuntu_data_sharing/ scares me. Debian (again AIUI) is in a code freeze before a major upgrade, so I shall wait before making critical decisions.
Regards,
John Davies
| [reply] |
|
Bod:
I'm not a Raspberry Pi guy (yet), but I'd expect it to work like a typical 32-bit x86 installation; meaning that while a single process is limited to 4GB, the OS can have multiple processes running to use the entire 8GB address space of the CPU. So you won't be wasting the capabilities of your 8GB RPi unless you're running just a couple of processes.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
| [reply] |
|
Re: New-to-Perl: recommendations for windows setup?
by Discipulus (Canon) on Feb 16, 2021 at 12:16 UTC
|
Welcome to hell bliako :)
> I can exclude from the beginning, methods involving cmd.exe ..
I dont. I always go with strawberry perl portable edition.
Strawberry portable ships with portableshell.bat which permit you to forget PATH because it prepends itself to everything (this setting is not OS wide: it is valid only for this prompt instance):
----------------------------------------------
Welcome to Strawberry Perl Portable Edition!
* URL - http://www.strawberryperl.com/
* see README.TXT for more info
----------------------------------------------
Perl executable: C:\perl5.32.64bit\perl\bin\perl.exe
Perl version : 5.32.0 / MSWin32-x64-multi-thread
C:\perl5.32.64bit> path
PATH=C:\perl5.32.64bit\perl\site\bin;
C:\perl5.32.64bit\perl\bin;
C:\perl5.32.64bit\c\bin;
C:\WINDOWS\system32;
C:\WINDOWS;
....
I use also unxutils or gnuwin32 and yes they are both really old, but they used to work. I modify portableshell.bat to include them after strawberry.
Or you can use cygwin or bash for window or .. good luck :)
Once upon a time there was padre perlide but I fear is no more maintained.
Activestate has KomodoIDE available for free (only mail subscrition needed).
Personally I use Notepad++ and the above portableshell.bat
I always avoid file association: I tell the OS all perl files are text documents and I open them with Notepad++ then in my commandline I always use: perl myscript.pl syntax.
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
| [reply] [d/l] [select] |
|
I also use Strawberry Perl Portable Edition, on servers and laptops (enterprise-locked).
Installing CPAN modules works fine with portableshell.bat and you don't need it to execute a Perl script : just use the full path to perl.exe. That's how I call Perl scripts from a batch file.
It's possible to run a Perl script from Notepad++ (stdout only), see https://amazingperl.blogspot.com/2013/01/use-notepad-as-perl-ide.html
| [reply] |
|
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by davido (Cardinal) on Feb 16, 2021 at 15:36 UTC
|
Strawberry Perl is relatively full-featured, and allows the user to use standard CPAN tools for installing modules.
I don't know if the Padre IDE is up to date anymore. I never really got it working right and couldn't be bothered trying. When I used to use Windows I used Geany as my editor, though if I were to go back to Windows I would probably use vim or gvim.
Nowadays I would probably prefer using the Windows Subsystem for Linux instead of straight Windows Power Shell or Command line. With WSL you should be able to install a linux flavor of Perl using typical build tools. I like Perlbrew or PLENV for managing a non-system Perl (or several of them).
Click-button module management and a Perl IDE used to be the domain of ActivePerl from ActiveState. Active Perl and Strawberry Perl are two different builds, and two different ecosystems. ActivePerl, back when I used it over ten years ago, had more of its own package management system, whereas Strawberry Perl provides the Perl-standard module management system.
Please keep in mind that with Windows Subsystem for Linux, or with VirtualBox, or even with Docker, you can be far less reliant on the underlying operating system nowadays.
| [reply] |
|
| [reply] |
|
That's sort of an either/or suggestion:
Either use WSL with a standard Perl install facilitated by Perlbrew or PLENV, or use Strawberry or ActivePerl under vanilla Windows (not using WSL). I would lean toward WSL unless you need to get closer to the Windows OS components than WSL supports.
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by holli (Abbot) on Feb 16, 2021 at 14:01 UTC
|
| [reply] [d/l] |
|
| [reply] |
|
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by stevieb (Canon) on Feb 16, 2021 at 15:48 UTC
|
berrybrew. Allows you to install, use and remove Perl instances on the fly from within a small GUI.
intelliJ IDEA is a free, fully featured IDE, and after installing the Perl5 plugin, works seamlessly with your berrybrew installation's managed Perl instances. I (the author of berrybrew) has worked with the author of the Perl5 plugin for this integration.
| [reply] [d/l] |
|
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by roboticus (Chancellor) on Feb 16, 2021 at 16:18 UTC
|
bliako:
I'm sure I'm in the minority, but I'm partial to installing cygwin and its perl. It works pretty well for what I do. It makes for a pretty decent *nix-like environment, with mintty for the terminal/console.
I've heard pretty good stuff about strawberry perl, but I haven't managed to install it such that it works seamlessly enough with cygwin for me. (Though I haven't tried recently, and don't recall what my issues were. Maybe I'll try it again the next time I (re)build a Windows box, and see if I can get more success next time.)
...roboticus
When your only tool is a hammer, all problems look like your thumb.
| [reply] |
|
I'm sure I'm in the minority, but I'm partial to installing cygwin and its perl.
I installed Cygwin about 5 years ago - and I still use it on a daily basis for ssh, git and svn.
The worst thing about it is its setup.exe - which you might need to use extensively if you want to install all of the modules that ship as standard with Strawberry Perl.
I'm damned if I know how it's supposed to work. I've got a procedure written down that does work if I follow it religiously, but it involves closing and re-starting setup.exe, which is ridiculously clunky.
Maybe I was doing it wrong and/or maybe it has since been improved.
The other annoyance was that it didn't provide a sufficiently recent version of autotools, for which I switched to using my Ubuntu box, and then scp the result across.
I'm still using the Ubuntu box in that way even though I would expect that, by now, a sufficiently recent version of autotools is available for Cygwin via setup. (Such is my fear of the dreaded setup.exe ;-)
I wonder if they're a "bit behind" with other software, too - or was it just autotools ?
Cygwin's perl is fine, and easy enough to build from source - though I rarely use it as native Windows perls (both self-built, and Strawberry) provide all that I need.
Cheers, Rob
| [reply] |
|
I remember trying to install cygwin a year ago in some other machine but something failed while compiling things: I think at linking it was looking for .so files instead of .dll. And I quickly gave up since it was just an experiment. Thanks for the suggestion. If it eventually works, a bash-like windows terminal sounds great.
| [reply] |
|
G'day bliako,
I went through this process about 18 months ago.
I asked similar questions to you and, like you, I got a lot of replies.
It ended up a rather long thread; read it all if you want; here's my three main posts:
Here's a brief, non-exhaustive, overview of features:
-
The Win10+Cygwin provides a Unix environment.
It's not substantially different from the Linux (OpenSUSE) machine I use for $work.
-
I run bash on a mintty xterm (Cygwin64 Console).
It provides a vi interface on the command line (set -o vi in ~/.bashrc).
It has all the usual Unix commands and utilities.
-
I have Perlbrew installed. I initially used this to install Perl 5.30.0;
I subsequently used the same to upgrade to 5.32.0 and later to 5.33.5.
-
I run an X Server with Cygwin XLaunch.
Perl Tk programs work fine with this.
(There's actually 16 X Servers available.)
-
I access many open source applications via aliases:
soffice file.docx (LibreOffice); foxit file.pdf (Foxit); and so on.
-
I have an Apache webserver set up.
Other webservers that are started by Perl web frameworks, e.g. Dancer2, also work without any problems.
-
I run network-related utilities, such as ssh and git, almost every day.
-
... and so on ...
In the main, I've had no trouble installing Perl modules.
One issue I had, took me a while to sort out: "cpan: Terminal does not support AddHistory.".
With another, I needed help from fellow monks: "Update XML::LibXML - can't find "xlocale.h"".
There's a number of open source applications that I access directly from Win10: Firefox; Thunderbird; Vlc; and others.
I use this setup five days a week for $work; and seven days a week for my own projects.
Overall, I'm very happy with what I have.
I felt this was getting overly long; I could've written a lot more.
Please ask if you have any specific questions about things I haven't touched on, or areas where you'd like further details.
| [reply] [d/l] [select] |
|
|
|
Re: New-to-Perl: recommendations for windows setup?
by GrandFather (Saint) on Feb 16, 2021 at 20:29 UTC
|
I strongly endorse the use of Komodo editor. I've been using it for years, long before it became freely available. It is a true IDE with great editing features and very cleanly integrated run and debug.
I use Strawberry Perl at work where I just need a stable Perl and BerryBrew with various version of Strawberry Perl at home where I need to mix and match different versions and builds of Perl.
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by syphilis (Archbishop) on Feb 16, 2021 at 23:45 UTC
|
There have been a few mentions of ActiveState perl.
Based on my experiences of it of a few months back, I would recommend that you avoid it ... unless you are looking for something that will substantiate your Windows prejudices.
Cheers, Rob | [reply] |
|
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by alexander_lunev (Pilgrim) on Feb 16, 2021 at 13:53 UTC
|
I'm using Strawberry Perl and Vim on Windows. | [reply] |
|
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by LanX (Saint) on Feb 16, 2021 at 18:37 UTC
|
> P.S. I have asked this on CB and LanX and Discipulus already gave some advice. Thanks!
I understood your question in the CB as directed at a total beginner who should see progress ASAP.
That's why I recommended ActivesState (AS), that is AS Perl + AS Komodo.
BUT this is a mixed bag, because I don't like using them in production.
AS Komodo has a flat learning curve, people can visually set breakpoints in the code and run the debugger with a click.
It automatically runs perl -c in the background and shows compilation problems by underlining them. (called "flymake" in emacs'ish)
And there are opensource versions out now.
BUT I don't like it being slow compared to Emacs, and I'm worried about it's dependency on Mozilla's XUL
AS Perl comes with an installation GUI called 'ppm', many modules are pre-compiled on their servers and you just install them by choosing from a list and updating. BUT not all modules are available, firewall might block their servers, and if you want to maintain a slightly outdated Perl installation you need to pay for licensing.
I prefer being able to use cpanm (m for minus) anytime.
My colleagues are hooked on these products and I'm continuously struggling to explain to them that "reality" is more complex than their spoiled Perl interface shows.
They excel simply because dumbed down features are easier to make fool-proof. But with a growing project/team you can't dumb down reality anymore.
It's AS business model! (which is fine if you know about the consequences)
OTOH this interface could hardly be easier for total beginners.
YMMV
| [reply] [d/l] [select] |
|
| [reply] |
|
I do too use cpanm from my linux commandline and I hope that I will have it available on the windows terminal too with Strawberry (I mean all that PATH hell).
This is what confuses me. Where have you gotten the impression that it's hard to set up the paths correctly for cpanm with Strawberry? Literally, if you install the full-installation strawberry, it sets the path correctly (adds three directories) one time, and it just works. If you use the portable strawberry, you either have to use its portableshell.bat to set up the environment each time you need it, or you can manually add those three directories into your permanent path, and it works. Since this is for a new-to-perl user, you're not going to be setting up multiple perls (in the end), so you don't have to worry about multiple strawberries, or strawberry-vs-active-state.
c:\strawberry\c\bin => this is where gcc and gmake (etc) live
c:\strawberry\perl\bin => this is where perl.exe and cpanm (aka
+cpanm.bat) (and other similar tools) live
c:\strawberry\perl\site\bin => this is where other module-installed t
+ools live (for example, in my setup, Devel::Cover's cover (aka cover.
+bat) goes here)
For my experience with Strawberry, cpanm just works. It's only if you are trying something unusual that things go awry. (More likely to cause a problem is having some other mingw gcc compiler in your path before strawberry's gcc. And that can be easily solved by giving the priority to the strawberry path. ;-) ) | [reply] [d/l] |
|
|
berrybrew's purpose is managing all of that PATH hell.
That's literally its job, and what it does.
Install it via its installer, then in the UI, Install a version of Perl, Switch to it, then open it up to use it.
You can install any number of Perls you want, and switch back and forth between them, or "Use" any one of them on the fly without having to change anything else.
| [reply] [d/l] [select] |
|
|
Well if it's for a kid this might be the best choice, good luck! :)
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by tobyink (Canon) on Feb 17, 2021 at 19:38 UTC
|
I didn't use an IDE until very recently. I'm now using Atom — it's not great for Perl out of the box, but it's very tweakable, and it ended up being the IDE that I could most adjust to my way of working. At some point I should blog about which plugins, etc I'm using.
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by karlgoethebier (Abbot) on Feb 18, 2021 at 20:19 UTC
|
My 2 ˘: Two questions, two answers. 1.: Strawberry portable. 2.: There is no really good Perl IDE. Notepad should be good enough for a beginner on M$-Dog. Else Notepad++
«The Crux of the Biscuit is the Apostrophe»
| [reply] |
|
| [reply] |
|
Yes, sure. I used it for decades on Linux, Windows and Mac. Unfortunately it disappeared on the Mac with the last update. And unfortunately my beloved Elisp macros disappeared as well. Holy Joe! Now I have to mess around with this plague called Aquamacs. BTW, my last resort for real operating systems was zile. I always had a compiled version at hand for copying to ~/bin on boxes that only had this other plague known as vi.
«The Crux of the Biscuit is the Apostrophe»
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by LanX (Saint) on Feb 17, 2021 at 22:42 UTC
|
Trouble with this thread is that you are asking two complex question at the same time.
- which Perl for Win
- which IDE
Actually you can combine them as you like. Any good IDE will allow you to customize whatever interface you need to Perl.
And IDE discussions are a mixed bag, because nobody has the resources to have tried them all.
Plus the "experts" can't even agree on the same wording when discussing them.
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by thechartist (Monk) on Feb 22, 2021 at 19:58 UTC
|
On Windows, make your life easy and download Strawberry Perl. If you want to make your life even easier for a M$ install, I can recommend berrybrew, which will help you manage multiple Perl installs if you want to avoid cygwin. Strawberry Perl provides the MinGW toolchain so you can build CPAN distributions, or write your own in any GCC supported compiled language (usually C/C++).
Unfortunately, I find a large number of modules fail to build on Windows, despite the good work the Strawberry Perl team has done with providing a Perl environment that mostly works. If your Perl scripts need to work on multiple systems, seriously consider cygwin or the Linux subsystem for Windows.
| [reply] |
Re: New-to-Perl: recommendations for windows setup?
by Anonymous Monk on Feb 17, 2021 at 14:56 UTC
|
Strawberry is good if you just want Perl. Or ActivePerl, which was the go-to once upon a time. Cygwin gets you a complete(-ish) U**x environment, including Bash. And, of course, Perl.
Another way to get a U**x environment is to install Oracle's VirtualBox. The price is right (i.e. free). Access to external peripherals is a bit dodgy, though there is something they call "Guest Additions" that allows you to mount a directory on the host machine in the guest operating system -- at least for given combinations of host and guest. And yes, it works for a Linux guest on a Windows host. Or vice versa, for that matter.
Honestly, I would probably go with Strawberry. I only mention VirtualBox as an alternative to throwing hardware at the problem.
| [reply] |