(print "Program Error!" && exit(0)) unless ([case is true]); #### # open the file - read # swap the update_info=blah line to update_info=auto my @lines = map {s/^update_info=(?:\w+)/update_info=auto/; $_ } ; # close file # open the file - write foreach (@lines) { print TOFILE; } # close file