473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Perl in Java

11
HI,

I have a perl script that I want to call in java. I can call it, the only problem is that the perl script has <STDIN> and the perl sciprt doesn't work. Other perl scripts(without <STDIN>) do work however. here is my code:

Expand|Select|Wrap|Line Numbers
  1. import java.util.*;
  2. import java.io.*;
  3. class Rename {
  4.     public static void main(String args[]) {
  5.         try {
  6.             Runtime r = Runtime.getRuntime();
  7.             r.exec("perl mydir/rename.pl");
  8.         } catch (Exception e) {
  9.             e.printStackTrace();
  10.         }
  11.     }
  12.  
Apr 12 '07 #1
6 1188
KevinADC
4,059 Expert 2GB
"doesn't work" is too vague. If it has <STDIN> is the perl programming waiting for some user input?
Apr 12 '07 #2
bdan44
11
yes. the perl script needs some user input. however, the java program doesn't provide an oppurtunity for the user to provide said input, or at least it doesn't in its present state.
Apr 12 '07 #3
KevinADC
4,059 Expert 2GB
Seems like a JAVA question. There is a perl module called Expect but I don't know if it will work in this situation.
Apr 12 '07 #4
miller
1,089 Expert 1GB
Seems like a JAVA question. There is a perl module called Expect but I don't know if it will work in this situation.
Moving thread to the Java Forum.

- Miller
Apr 12 '07 #5
bdan44
11
bumping to top
Apr 15 '07 #6
bdan44
11
bumping again. if you have knowledge, please help.
Apr 17 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Lionel | last post by:
Hi all, I would like having more informations on how we could exchange informations and/or objects between PERL and JAVA. We have a Java programs that open, maintain and close telnet...
6
by: John Smith | last post by:
Hello, I have a rather odd question. My company is an all java/oracle shop. We do everything is Java... no matter what it is... parsing of text files, messaging, gui you name it. My question...
1
by: bezeee | last post by:
At my work we are in the process of building a tool to test an XML based API. Basically, XML in and XML out over http. Currently, there are two engines that do all of the schema validations, xml...
3
by: John Smith | last post by:
Hello, I have a rather odd question. My company is an all java/oracle shop. We do everything is Java... no matter what it is... parsing of text files, messaging, gui you name it. My question...
4
by: Firewalker | last post by:
Hey guys, I am newbie to perl. I am trying to deal with dates ( such trying to find what the date would be after month). Is therea function or date class( I am a java programmer, I couldnt find...
0
by: bdan44 | last post by:
HI, I have a perl script that I want to call in java. I can call it, the only problem is that the perl script has <STDIN> and the perl sciprt doesn't work. Other perl scripts(without <STDIN>)...
9
by: peter | last post by:
Hi, this is not stinky bait. If you take it that way, please dont respond.. I have been away from UNIX software for quite awhile and want to get back into it. I liked "C" but Java seems like...
1
by: houh | last post by:
I have a java app that generates openoffice docs. When I run the java app in a shell script, as: export JAVA_HOME=/opt/corp/projects/metrics/Java/jdk1.5.0_07/bin/java export...
3
by: limnath | last post by:
Hello everyone, I am new here and very new to PERL, just reading a book on scripting in PERL. I have a quick need which I hope anyone can kindly help me. I need to invoke a Java program from...
13
by: Corey G. | last post by:
If Perl 6 ever does get on its feet and get released, how does it compare to Python 3000? Is Perl 6 more like Java now with Parrot? I just want to make sure that Python is staying competitive. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.