无法从服务器计算机运行perl脚本

时间:2011-11-18 08:52:47

标签: java perl

        String name="perl http://10.107.97.201//C:/KATool/code/names.pl ";
        Process p = Runtime.getRuntime().exec(name);

        BufferedReader stdInput = new BufferedReader(new 
             InputStreamReader(p.getInputStream()));

        BufferedReader stdError = new BufferedReader(new 
             InputStreamReader(p.getErrorStream()));

        // read the output from the command
        System.out.println("Here is the standard output of the command:\n");
        while ((s = stdInput.readLine()) != null) {
            System.out.println(s);
        }

我无法从服务器机器运行perl脚本..以上是服务器ip(虚拟),在应用程序中提到。 请帮帮我.. 并提前感谢..

2 个答案:

答案 0 :(得分:2)

perl处理的是文件系统,而不是互联网协议,所以当你给perl“http:// ...”它就像你给了记事本“http:// ...”一样不计算

所以要在本地运行names.pl,首先你必须下载它(wget ...),然后运行它

答案 1 :(得分:0)

您是否可以访问远程计算机?你能从终端上运行这条线路吗?

perl http://10.107.97.201//C:/KATool/code/names.pl

在终端中运行此操作并调查您收到的错误消息。也许 perl脚本本身已损坏,或者只是您没有(或者您丢失)访问远程计算机。