title: Perl Script Configuration and Relative Path Implementation on both Windows (XP) / Unix (Solaris)
body: <p>Heylo,</p>
  
  <p>I'm experiencing, somewhat of, a conundrum regarding perl script development. I have written a small Perl script using the standard (basic) Perl installation. I have the following setup:</p>
  
  <p>C:\MyScript\perl.pl<br>
  C:\MyScript\configuration\config.ini<br>
  C:\MyScript\output\output.txt  </p>
  
  <p>This is the perl.pl source:</p>
  
  <pre><code>$config      = '/configuration/config.ini';
  $conf        = Config::IniFiles-&gt;new( -file =&gt; $config_file );
  $output_dir  = conf-&gt;val('output', 'out_dir');
  $output_file = "$output_dir/output.txt";
  
  open (out, "&gt;$output_file") || die ("It's not your day mate!");
  print out "This is a test...";
  close out;
  </code></pre>
  
  <p>This is the config.ini contents:</p>
  
  <pre><code>[output]
  output_dir = C:\MyScript\output
  </code></pre>
  
  <p>The problem I am having is that the second line ($conf) appears to be having trouble opening the file at that location. As I will be using this script in both a windows and unix environment (without installing any addition modules) I was wondering how I could get around this? What I was hoping was to create a script that would entirely configurable through the config.ini file. The config however, only works if I give it's absolute path, like so:</p>
  
  <pre><code>$config = 'C:\MyScript\configuration\config.ini';
  </code></pre>
  
  <p>But since this will be deployed to several diverse environments modifying the scripts source is out of the question. What would you guys recommend? How should one approach such a scenario?</p>
  
  <p>Any help and/or advice is greatly appreciated.</p>
  
  <p>All the best,
  MC</p>