$ perl -i -pe 's/the line to be replaced/this is the new line/' var.txt