3 ms·
Do any other languages really lend themselves to the one line command tools like perl does? The only one off the top of my head would be ruby but I don't have
by wx77 15y ago
Do any other languages really lend themselves to the one line command tools like perl does?
The only one off the top of my head would be ruby but I don't have that much ruby knowledge to judge.
This kind of thing however is perl's bread and butter.
- pkrumins 15y agoBenoit Hamelin did ruby one liners - http://benoithamelin.tumblr.com/ruby1line http://benoithamelin.tumblr.com/ruby1line
- jbum 15y agoAgreed - one reason why I still love Perl so much, despite its obvious warts.
- mapgrep 15y agoCompared to Ruby, one liners are more efficient in Perl because the normally infuriating cryptic variables and defaults save space. For example in Perl you can run a foreach without naming the current iteration value and it defaults to $_. $_ in turn is the default target for many commands, like print. So Perl's `print foreach @a` becomes Ruby's `a.each{|a| print a}`. Not so bad but it adds up.