Re:Awk vs. Perl (2009)
by kazinator on Wednesday June 28, 2017 @11:31AM
(#14654965)
The author of this article makes himself appear bat-shit crazy for his claims about Perl syntax being better.
In Awk, you can define a function like this:
function add(a, m, n,
sum)
{
for (sum = 0; m < n; m++)
sum += a[m]
return sum
}
Named parameters (wow, there is a concept); and few dermatological problems: no damn sigils, or required statement-terminating semicolons. The array reference is a[m], the scalar is m and so on.
Using an extra parameter (which is not specified in the call) for the local variable sum is a massive design fail, but no worse than any of the Perl design fails.
Perl repeats most of the design flaws in Awk, with compounded interest.
In Awk, you can define a function like this:
Named parameters (wow, there is a concept); and few dermatological problems: no damn sigils, or required statement-terminating semicolons. The array reference is a[m], the scalar is m and so on.Using an extra parameter (which is not specified in the call) for the local variable sum is a massive design fail, but no worse than any of the Perl design fails.
Perl repeats most of the design flaws in Awk, with compounded interest.