title: Sort file using pipe in perl
body: <p>I am looking for a way to sort a file using pipe. I have checked different examples online but I am still confused</p>
  
  <p>Let's say I have a file called "perlRocks.txt" with different names I want to sort.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>open(SORT, "| sort&gt;perlRocks.txt") or die "Can't sort";
  close (SORT);
  </code></pre>
  
  <p>What am I missing?</p>