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

BradV has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm trying to write a perl one liner to search for a specific <Directory ...> entry in httpd.conf, then search for the closing </Directory> and append a CustomLog line after that. I was trying perl -lne '/Directory.*awstats/;s/<\/Directory>/$1\n"CustomLog \/usr\/local\/awstats\/access_log combinedio"/' httpd.conf but that isn't working. Does anyone have a suggestions? Thanks!