if (-f $file) { open CONF, "<$file"; my @contents = ; close CONF; foreach $content (@contents) { my @config = split /-/,$content; if ($content =~ /DEFAULT_IN/) { $default_in = $config[1]; chomp($default_in); } elsif ($content =~ /DEFAULT_OUT/) { $default_out = $config[1]; chomp($default_out); } } } #### print CONF "DEFAULT_IN-$def_path\nDEFAULT_OUT-$def_path_out\n"; #### if( ($def_path ne $default_in) || ($def_path_out ne $default_out) ) { # at least one of the values changed, write both }