use strict; use warnings; use autodie qw( :all ); my $content; open my $in, '<', 'Makefile.PL'; while(<$in>) { s/^(# This file was automatically generated by Dist::Zilla::Plugin::Author::Plicease::MakeMaker).*$/$1/; $content .= $_; } close $in; open my $out, '>', 'Makefile.PL'; print $out $content; close $out;