You can take the opportunity to drop the dependency on perl by switching `perl -p -e` with `sed -re` here and a few lines above.