Skip to content

Comment on Moreshell tricks: first class lists, jq, and the es shell

Comments

I know Perl gets no love here, and for good reason sometimes, but I have a hard time believing that code full of syntactical characters like

  if .["found"] then
    . | .after += [$arg]
  elif $arg == "--" then
    . | .found = true
  else
    . | .before += [$arg]
  end
or
  for (i = $indicies) if { ~ $*($i) -- } {
      before = <= {
  ...
...is more readable and maintainable than:
  my ($before, $after) = split /\s*--\s*/, $input;
  my @list1 = split ' ', $before;
  ...
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.