I think a related factor is the shift from raw text to databases. Perl's text oriented tools shine (obviously) when there is a lot of text to deal with. There was a lot of that at the dawn of the web.
However, the rise of database backed web apps gradually removed a lot of the need for the special magic that Perl brought to the table.