title: perl sort temporary directory
body: <p>I ran into space issues on my machine and therefore the sort command in unix failed because of lack of space in /tmp. In order to circumvent this, I decided to run sort with the -T option allowing it to use some other directory for creating temporary files. here is the perl script I have</p>
  
  <pre><code>   my $TMPDIR              = "/home/xyz/workspace/";
      my $sortCommand         = "awk 'NR == 1; NR &gt; 1 { print \$0 | \"sort -T \$TMPDIR -k1,1\" }' test &gt; test.sort";
      system_call($sortCommand, "Sort");
      sub system_call {
        .......
  }
  </code></pre>
  
  <p>this works perfectly on my desktop but when I run this in a different machine I get the error</p>
  
  <p>"sort: cannot create temporary file: -k1,1/sortFoeXZx: No such file or directory"</p>
  
  <p>Any ideas ?</p>