title: run a perl script using java
body: <p>I have a file lowercase.perl ,this takes one file as an input and prints  all its content in lowercase into another output file.</p>
  
  <pre><code>use warnings;
  use strict;
  
  binmode(STDIN, ":utf8");
  binmode(STDOUT, ":utf8");
  
  while(&lt;STDIN&gt;) {
    print lc($_);
     }
  </code></pre>
  
  <p>and I want to run it from java</p>
  
  <pre><code>import java.io.*;
  
  public class Sample {
      public static void main(String args[]) {
          Process process;
          try
          {
              process = Runtime.getRuntime().exec("perl lowercase.perl  &lt;lower.eng&gt; lowerlm.eng");
  
              process.waitFor();
              if(process.exitValue() == 0)
              {
                  System.out.println("Command Successful");
              }
              else
              {
                  System.out.println("Command Failure");
              }
          }
          catch(Exception e)
          {
              System.out.println("Exception: "+ e.toString());
          }
      }
  }
  </code></pre>
  
  <p>but this is not working.
  All my files are in same directory and i am running terminal in same directory as well. What seems to be happening is that the perl script is being executed but the input parameter <strong><code>&lt;lower.eng&gt;</code></strong>(this has to be passed with diamond operators) that i have passed is not working properly.
  I have ran perl script directly and it is working fine if ran without using java.</p>