3 ms·
This is indeed why I use Perl over Ruby. As long as it's not for a Window machine, a Perl script is deployed by copying it over and that's it.
by kqr 2y ago
This is indeed why I use Perl over Ruby. As long as it's not for a Window machine, a Perl script is deployed by copying it over and that's it.
- noisy_boy 2y agoThat was the reason Perl was what I switched too from bash when I was working on Solaris boxes; it was miles ahead of what was possible with bash AND it was already present. If I remember an older version of Python was also installed but by then Perl had already got me reeled in and I felt Python to be too "verbose" compared to Perl (I eventually changed my opinion when I got a bit more experience under my belt).
- kqr 2y agoInteresting! I still find Python too verbose to stand in for shell scripts when Perl is available, with what I think is a decent chunk of experience.
- noisy_boy 2y agoHa - I actually haven't changed my opinion about verbosity, Python is still more verbose and I will choose Perl for throwaway scripts even today; I just have a greater appreciation of readability of Python code compared to the free-for-all style-fest of Perl code (admittedly written by a bunch of devs with little code style enforcement). Perl is great for smaller scripts but I'm talking about many thousands lines of code and the lack of native object orientation, messy error handling, lack of a decent repl etc start to take their toll.
- shrimp_emoji 2y agoThousands of lines := time to use a real (compiled) language
- noisy_boy 2y agoVery true; unfortunately quite often one is not in the decision maker's seat.
- petre 2y agoOne usually needs modules to easily do something more advanced, but yes, Perl is almost always installed. Although I find Ruby much more ergonomic, I still reach for Perl as well because I know it better and don’t have to open the documentation so often.
- pmontra 2y agoThat's true of Python and Perl as long as you keep using only the features built in in the core language (standard lib or whatever they call it.) The same applies to Ruby. My scripting language is bash in at least 99% of cases. I used to program in Perl when I need some complex logic. I stopped using it some 10 or 15 years ago when I switched to Ruby for two reasons: I became more familiar with it than with Perl and it's easier to manage data structures whenever I need something complex or classes. That doesn't happen often in scripts but as I wrote, I use bash for all the normal stuff. I use Python for the scripts that start an HTTP server because it has the http.server module in the standard lib and it's very simple to write handlers for GET, POST and all the other HTTP verbs. The last example was a script to test callbacks from an API. I just implemented two POST and PUT methods that print the request data and return 200 and a {} JSON. I think that to do the same in Ruby I would need to install the webrick gem.
- BiteCode_dev 2y agoIn fact, that's true for Python if you use a zipapp and no c extension: https://docs.python.org/3/library/zipapp.html https://docs.python.org/3/library/zipapp.html You can happily copy the zip of your scripts and all deps in the server. You still do have to mind your versions, as always with python.
- deleted 2y ago[deleted]
- kqr 2y ago> The same applies to Ruby. With a big difference -- Perl and Python will always be installed on these machines, whereas Ruby might need two deployment steps: (1) copy file, (2) install Ruby!
- MaxBarraclough 2y agoEven on Windows there's a good chance. The Git for Windows project bundles Perl, but not Ruby.
- brightball 2y agoPerl is deeply underappreciated and needs a lot more love. One of the keynotes at the polyglot conference that I run is going to be Perl talk and I'm really looking forward to it.
- pdimitar 2y agoDoes it still require global library / module installations for your script's dependencies? If so, hard pass.