This ought to be so easy that I'm probably looking in entirely the wrong direction. The code has to copy files into two directories, each with a slightly different list of files. I'm controlling this with two hashes %uf and %nf where the existence of a hash entry implies that the file is required and that entry is set to 0 or 1 depending on whether the file has already been copied. Here's a code snippet
The problem appears to be that 'system' returns 0 when the command works successfully and that is making it go down the or leg. i.e. it finds the file in $u_dir and links it but then proceeds to copy it as well.
Please point me in the right direction. Thanks
Ceci n'est pas une signature
Columb Healy
Code:
exists $nf{$fname} && $nf{$fname} == 0 and do
{
print "Processing $fname in $n_dir\n";
-f "$u_dir/$fname" and do
{ print "Linking $fname\n"; system "ln $u_dir/$fname $n_dir/$fname"; }
or do
{ print "Copying $fname\n"; system "cp $line $n_dir/$fname"; };
$nf{$fname} = 1;
};
Please point me in the right direction. Thanks
Ceci n'est pas une signature
Columb Healy