title: Perl read_config sub, oop or not?
body: <p>I have a package (really just one subroutine) I use frequently to parse config file etc. Basically it looks like this:</p>
  
  <pre><code>sub get_settings {
          my %config;
          my $config = 'path...';
  
          unless(-r $config) {
                  die("Couldn't read config");
          }
          open CONFIG, '&lt;', $config or die $!;
          while(&lt;CONFIG&gt;) {
                  next if (($_ eq "\n") or /^\;/);
                  chomp;
                  my($setting, $value) = split(/=/, $_);
                  $config{$setting} = $value;
          }
          return %config;
  }
  </code></pre>
  
  <p>Pretty basic, but I was wondering how (and if) this could/should be re-written to <strong>OOP</strong>? Really just for learning, never quite seen when and why to use <strong>bless</strong>. =)</p>
  
  <p>Thanks! </p>