That's easy to do.
But that's not the end of it. The whole point of Perl is avoid a salad of C and shell utils. Also in many cases the moment you have to deal with >2 files at a time shell utilities begin to show their limits.
The resulting code is often far more unreadable than anything you will ever write in Perl.
Re:The Awk Programming Language (1988) [pdf]
by Annatar on Tuesday May 29, 2018 @05:54AM
(#17177772)
I’m sorry you believe that, but it’s simply not true, especially since UNIX is designed to be driven by a combination of binary code and shell executables. Perl is a mess whose syntax borders on hieroglyphic once poured into software. That doesn’t mean that it’s not a capable language; but it’s not a language in which written programs are maintainable or easily debuggable.
Yes, writing a build engine in AWK would be perfectly doable, but the right tool for that job is Make.