http://www.perlmonks.org?node_id=1098770


in reply to Re: RFC Using PERL HEREDOC script within bash
in thread RFC Using PERL HEREDOC script within bash

Maybe when forced to incrementally "port" a legacy bash script to Perl. I have re-implemented some bash scripts in the past.

One legacy bash scripts that stands out in my memory, had several embedded AWK and Sed scripts. Management was very sceptical, so I had to do it incrementally. Phase 0, I replaced the AWK and Sed scripts with Perl equivalents. In some cases, I was able combine adjacent AWK/Sed scripts into a single Perl script. This was fortuitous because it gave a small but measurable performance boost. After demonstrating the new version worked correctly, I moved to phase 1 to re-implement the rest of the script, which was straight forward. The end result was much faster and much less fragile, therefor much easier to maintain and improve.