3 ms·
I want to write some scripts that are _slightly_ too complicated for bash. Basically just implementing some simple scripts that have a couple options/args and I
by zests 7y ago
I want to write some scripts that are _slightly_ too complicated for bash. Basically just implementing some simple scripts that have a couple options/args and I want to use another tool.
How good would perl 5/6 be for this?
If not perl, anything similar that's not python? I want to learn something new.
- Grinnz 7y ago"This would be annoying to write in bash" is a very popular use case for Perl (5).
- ttkciar 7y agoYes, what Grinnz says. "Bash on steroids" is one of perl's strongest use-cases. It's why a lot of system administrators learned perl.
- Qcombinator 7y agoSounds like the perfect opportunity to check out P6. It's stable enough and has a lot of cool features if you want to learn something new. It even has built-in multi-dispatch command-line arg-processing: https://docs.perl6.org/language/create-cli https://docs.perl6.org/language/create-cli
- perlperson 7y agoThis is a _perfect_ case -- to get started, you can just put `shell` in front of every line #!/bin/bash echo hello change to #!/usr/bin/env perl6 shell "echo hello" then for arguments, try making `foo.p6` #!/usr/bin/env perl6 unit sub MAIN($name,:$times,:$language); say $name, $time, $language and run ./foo.p6 --help
- daotoad 7y agoAs I said elsewhere in this thread, check out my article for the 2018 Perl6 Advent Calendar. https://perl6advent.wordpress.com/2018/12/16/day-17-checking-your-list-twice/ https://perl6advent.wordpress.com/2018/12/16/day-17-checking... I walk through the development of a utility for auditing Santa's Naughty and Nice lists. Along the way, I introduce literate programming, multiple dispatch, types, type subsets, links to documentation, perl6 collections, and File IO. And, I've been told I managed to do all this without making the reader they've been dragged over rough ground behind a certain festive sleigh. The key thing to remember when you start learning a Larry Wall Language is that you only need to worry about the parts you need to worry about. It's more like learning a natural language than a programming language. Learn how to say the things that are important to you, and it will serve you well even if you speak with an accent.