sub changeData{ my ($self) = @_; `$toolPath/an2k2txt ./Templates/DFP.nst ./tmp/Data2`; open my $handle, "<", "./Data2"; my $file = new IO::File("./$self->{_nistName}.tmp","w"); my $data; while(<$handle>){ if ($_ =~ m/$self->{_field}/i){ chomp($_); $_ =~ s/=.*//; #Seems that \x1F\x0A is the delimiter at the end of the lines $data = $_."=".$self->{_newValue}."\x1F\x0A"; print $file $data; } else{ print $file $_; } print "$_\n"; } close $handle; `$toolPath/txt2an2k ./$self->{_nistName}.tmp ./Nist/$self->{_nistName}.bad`; system("rm -f ./*.tmp"); }