in reply to Re^7: Split tab-separated file into separate files, based on column name (open on demand)
in thread Split tab-separated file into separate files, based on column name

> Yes, but the optional implicit outer loops in Perl are different from the implicit outer loop in Awk — Awk's syntax is built around its implicit outer loop, using PATTERN-RULE pairs, while Perl's implicit outer loops are purely for convenience. I have always just written an outer loop explicitly even in one-liners.

I have trouble understanding what you mean.

AFAICS are awk's PATTERN-RULES nothing more than if(PATTERN) { RULE } in Perl, plus some special defaults (no Rule means print)

Could you give an example where perl -n fails to allow the same semantic like in awk?

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^8: Split tab-separated file into separate files, based on column name (open on demand)
  • Select or Download Code

Replies are listed 'Best First'.
Re^9: Split tab-separated file into separate files, based on column name (open on demand)
by jcb (Parson) on Aug 30, 2020 at 02:21 UTC

    The semantics are the same but the syntax is different and the input range operator in Awk only works in pattern syntax; Perl's equivalent .. and ... operators work anywhere.

    The Awk syntax is more elegant for some problems — and completely unusable for most problems better solved in Perl.