4 ms·
FWIW, Ruby has a lot of the same command line arguments that Perl does.
by davidw 9y ago
FWIW, Ruby has a lot of the same command line arguments that Perl does.
- lloeki 9y agoRuby does not have $_ which you happen not to see in perl one liners because of its implicit nature, and that makes those one liners very clear and terse.
- davidw 9y agoRuby has $_ seq 1 20 | ruby -pe 'puts "num is #{$_}"' Perl is probably a bit more concise, but you can do a lot of stuff with Ruby, which is convenient if you use it for other things too.
- vram22 9y agoYes, Ruby was inspired quite a bit by Perl. Matz says so somewhere, IIRC. Even it's regex support (I mean the way it is integrated into the language, unlike in Python, not that fact that Ruby supports regex per se), and some language features, are inspired by Perl. Also either or both of Lisp and Smalltalk, I've read.