<?xml version="1.0" encoding="windows-1252"?>
<node id="999373" title="Re^2: Directory independent processing" created="2012-10-16 12:44:31" updated="2012-10-16 12:44:31">
<type id="11">
note</type>
<author id="769448">
biohisham</author>
<data>
<field name="doctext">
The programs are in 'project/PerlCode' as well as the other folders 'test', 'data' and 'report', all of these are in 'project' so if I placed the directory 'project' anywhere it will carry with it the folder 'PerlCode' and the rest. 
&lt;p&gt;
Assuming that the current working directory is 'project' is a very plausible approach that I have partly implemented. I could probably hard-code the rest of the folders within CWD as they are.
&lt;/p&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;(Oct, 30th) UPDATE:&lt;/b&gt; I have implemented this through Cwd. Trying the other suggestions such as File::Spec threw errors that I could not solve. So through Cwd I basically could achieve creating new folders within 'project', moving files  across these folders, and call other scripts that are saved in 'PerlCode' within 'project, it sounds fine and it performs the way I expect it to and ports well ...
&lt;c&gt;
use Cwd;
my $dir = getcwd;

mkdir("$dir/output", 0777);
open (my $fh, "&lt;","$dir/data/file.txt") or die ("$!");
open(my $ofh, "&gt;", $dir/output/outfile.txt) or die("$!");
while(my $line = &lt;$fh&gt;){
    #do stuff such as process load into a data structure, regex
    #write to $ofh
    }

&lt;/c&gt;
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;code&gt;
&lt;/code&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-769448"&gt;
&lt;hr&gt;
David R. Gergen said "We know that second terms have historically been marred by hubris and by scandal." and I am a two y.o. monk today :D, June,12th, 2011...
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
999160</field>
<field name="parent_node">
999164</field>
</data>
</node>
