Name "main::v" used only once: possible typo at ... line ... Use of uninitialized value $_ in pattern match (m//) at ... line ..., line 1. street.addressstreet.address=#enter address# city.name=place state.name=unknown #### if ($tmpLine =~ /$k/) #### foreach $line () { ($k, $v) = split /=/, $line; seek(templateFile, 0, 0); # <== ADD THIS LINE foreach $tmpLine() ... #### use strict; use warnings; #### open(my $templateFile...) #### open(my $currentValues, '<', 'current.txt') or die ...