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

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

I have script to where I am looking to update a date format, but for some reason my new file is not being created and I cannot see what I am missing or what is wrong. If someone could point out what I have wrong it would be truly appreciated.

use strict; open(INFILE, "PSR_Date.txt"); open(OUTFILE, ">PSR_OutputDate.txt"); while (<INFILE>) { $line = $_; $line =~ s/(\d{4})-(\d{2})-(\d{2})\s\d{2}:\d{2}:\d{2}/ +\2\/\3\/\1/g; print OUTFILE "$line"; } close INFILE; print "Done!\n"; chomp($pause = <STDIN>); _DATA_ OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,2015- +06-20 00:00:00 _OUTPUT_ OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015 OD44202,07/01/2015,08/19/2019,08/27/2019,1,07/01/2015,06/30/2019,06/20 +/2015