be evenly obvious, although there is still no comment?sub discard_sortkey { unpack 'x[nn]A*' }; sub prepend_yearmonth { my( $alpha, $num ) = m[^(\S+?)\s*(\d+)$]; $num += 2000 if $num <= 49; $num += 1900 if $num <= 99; pack 'nnA*', $num, $months{ $alpha }, $_; } print for map{ discard_sortkey } sort map { prepend_yearmonth } <DATA> +;
My field of operations was mainly CRM/ERP systems. At my first job, we used AWK to generate COBOL program source for the different target systems. At my previous job I still generated (and sometimes programmed) COBOL - in this very century. Of course, when Perl became known, I liked it at first sight, especially because I knew the patchwork tools it aimed to replace.
OTOH, most of the languages I had worked with before, had variable declarations and no "contexts", hence no need for sigils. Thus, when I later saw Python, I liked it, too. I think this is what the OP called "cleaner".
I see virtues in both approaches.
(Update: Originally posted under a different node in this thread)In reply to Re^8: I want you to convince me to learn Perl
by soonix
in thread I want you to convince me to learn Perl
by kasxperanto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |