perl -pi-i -e "BEGIN{@ARGV=map{glob}@ARGV}" *.pl REM check the new *.pl file contents REM if everything looks good, then: del *.pl-i