3 ms·
On that note, awk shows up a lot in the shortest solutions because of the ease with which it parses input files. I haven't used perl myself, so can anyone comm
by SilasX 12y ago
On that note, awk shows up a lot in the shortest solutions because of the ease with which it parses input files.
I haven't used perl myself, so can anyone comment on the merits of perl vs awk here? They often compete for this use case.
- grondilu 12y agoOversimplifying a bit, I'm going to tell you that Perl was initially conceived as a mix between C, sed and awk. So, there are quite a few awk idioms that are directly translatable in Perl. As a matter of fact, there even is a section dedicated to awk in perltrap[1], enumerating the differences between the two languages. 1. http://perldoc.perl.org/perltrap.html#Awk-Traps http://perldoc.perl.org/perltrap.html#Awk-Traps