Perl seems to be fading away, but for a long time it was the obvious tool to use when your program got too big for a shell script.
> Python, Go and so on need more structure and often don't have quite as simple and convenient methods of doing various shell like things.
This is Perl's niche, or at least it was Perl's first niche before it started getting used for CGI. The things you'd do in a shell script are generally convenient in Perl too, the main inconvenient part is selecting from the many different ways to invoke a program in Perl, like system(), backticks, qx//, open(), etc.
Perl is also more commonly installed and has faster startup time than Python, in my experience.