Perl5 was built more for CLI programs and text processing tasks, like Awk. As the internet got bigger, Perl5's idiosyncrasies became more evident. People wanted a cleaner and more structured language that could remain readable in large code bases.
I remember building backends in the late 90s in Perl and yearning for something more structured. Perl5 often just felt so hacky and full of magic, often resulting in unreadable code. When I first saw Python I was struck by how clean and uniform it was compared to Perl5.