title: Need explanation on reading "config" file in Perl
body: <p>I am learning Perl.</p>
  
  <p>I saw a script using function "do" on a file. Then i read that about that function :</p>
  
  <blockquote>
    <p>If do can read the file but cannot compile it, it returns undef and
    sets an error message in $@ . If do cannot read the file, it returns
    undef and sets $! to the error. Always check $@ first, as compilation
    could fail in a way that also sets $! . If the file is successfully
    compiled, do returns the value of the last expression evaluated.</p>
    
    <p>Inclusion of library modules is better done with the use and require
    operators, which also do automatic error checking and raise an
    exception if there's a problem.</p>
    
    <p>You might like to use do to read in a program configuration file.
    Manual error checking can be done this way:
    You might like to use do to read in a program configuration file.
    Manual error checking can be done this way:</p>
  
  <pre><code># read in config files: system first, then user 
  for $file ("/share/prog/defaults.rc",
             "$ENV{HOME}/.someprogrc")     {
      unless ($return = do $file) {
          warn "couldn't parse $file: $@" if $@;
          warn "couldn't do $file: $!"    unless defined $return;
          warn "couldn't run $file"       unless $return;
      }
  }
  </code></pre>
  </blockquote>
  
  <p>I don't understand why they are talking about compiling a config file?
  What kind of config file it is? Why/When do we use that config file ?</p>
  
  <p>Thanks</p>