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


in reply to removing square brackets

If this is all you're doing to the files, look at the -i, -e and -n/-p switches to perl in perldoc perlrun. Also perlre.