Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Shake: Every Program Can Be a Clojure Function.
If i'm using Perl's Shell.pm (as mentioned elsewhere here by btilly) and wanted to avoid quoting arguments then I could do:
use 5.016; use warnings; use Shell (); use PerlX::QuoteOperator ls => { -emulate => 'qq', -with => sub ($) { Shell::ls($_[0]) }, }; use PerlX::QuoteOperator uname => { -emulate => 'qq', -with => sub ($) { Shell::uname($_[0]) }, }; use PerlX::QuoteOperator ip => { -emulate => 'qq', -with => sub ($) { Shell::ip($_[0]) }, }; # and then... ls(); uname(-a); ip(-4 addr);
`ls`; `uname -a`; `ip -4 addr`;
my $x = "/usr/local/"; my $files = `ls -l $x`;
my $perl_files = `ls | grep .pl`;
There are no comments on this comment yet.
If i'm using Perl's Shell.pm (as mentioned elsewhere here by btilly) and wanted to avoid quoting arguments then I could do:
But this seems to be an overkill because I could just use Perl's backticks (http://perldoc.perl.org/perlop.html#Quote-Like-Operators)... And it works with variables... and piping... Shell.pm also works with variables & piping but I think that backticks are probably Perl's best DSL for dealing (easily) with shell stuff :)