3 ms·
What's the 2-3 line alternative to perl you are referring to? I find piping into python to be a lot more than 2-3 lines before I'm even ready to do any manipul
by wodenokoto 2y ago
What's the 2-3 line alternative to perl you are referring to?
I find piping into python to be a lot more than 2-3 lines before I'm even ready to do any manipulation of input, which again can get quite verbose. So I'm guessing it is not python.
- wruza 2y agoI meant average line ratio, not literal one-liners, apologies for confusion.
- chongli 2y agoWhen you're talking about doing things interactively (in a shell, either directly via a terminal or indirectly via an editor) then the constant factors matter far more than the asymptotics. This has always been perl's target for optimization. That's why it has a million obscure operators that no other language has.
- lloeki 2y agoRuby? It has perlisms and awkisms around, here's a stupid example: echo -e "foo 1\nbar 2\nbaz 3" | ruby -n -e 'BEGIN { puts "===" }; $_ =~ /^b\S+ (.*)/ and puts "#{$_.chomp.upcase} => #{$1}"; END { puts "===" }' There's -p too, -0777 works for slurp mode, throw in -rjson to get battery-included pretty_generate, interpolation can be nicer, but $_ is not implicitly used so it can get a bit more verbose than Perl.