new2code Posted May 6, 2010 Share Posted May 6, 2010 Hi Everyone, I have a perl script and a java sript. I need to run the perl script first and parser a txt file and then run a java scrip to convert that file to a png. here is an example of the script I will have to run. both this command on the terminal to get an output file (output.png) 1. perl xml_builder.pl -sequence /sequences.txt -output /data/done_sequesnces.xml -tick_density 0.7 2. java -jar view.jar -i /data/done_sequesnces.xml -o /data/output.png -f png I have to run both this command on the terminal to get an output file (output.png) is there a way I can and html or a php page that instead of using a text file (sequences.txt) I can past the text in a text box or if not upload the txt file. And when pressed submit it will run the Perl script and the Java script to output the png file to a folder? I know its seesm to be allot to ask, but I know there are excellent programmers here who can do wonders. I am at a very basic level of programming. Any Help Will be Much appreciated. Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/200953-text-input-run-perl-script-java-output/ Share on other sites More sharing options...
trq Posted May 7, 2010 Share Posted May 7, 2010 Does xml_builder.pl have an option to accept input from stdin? ps: jar files are Java, not Javascript. There is a massive difference. Quote Link to comment https://forums.phpfreaks.com/topic/200953-text-input-run-perl-script-java-output/#findComment-1054455 Share on other sites More sharing options...
new2code Posted May 7, 2010 Author Share Posted May 7, 2010 Hi Im not sure the xml_builder.pl has a the option to accept stlin. and sorry about my the Java script misunderstanding . what I was thinking is to have a text box when I submit some text through it creates a text file and that text file is then ran through the xml_builder.pl using exec and the resulting file is again run through the jar file and the final image to be displayed in the browser. is this possible? Text box ---> textfile ---> execute perl script on text --- xml output ---> java ---> image Quote Link to comment https://forums.phpfreaks.com/topic/200953-text-input-run-perl-script-java-output/#findComment-1054596 Share on other sites More sharing options...
trq Posted May 7, 2010 Share Posted May 7, 2010 what I was thinking is to have a text box when I submit some text through it creates a text file and that text file is then ran through the xml_builder.pl using exec and the resulting file is again run through the jar file and the final image to be displayed in the browser. is this possible? It is possible, but likely not required as most Perl scripts should accept data from stdin. I suggest you find out if it does or not. Quote Link to comment https://forums.phpfreaks.com/topic/200953-text-input-run-perl-script-java-output/#findComment-1054599 Share on other sites More sharing options...
new2code Posted May 8, 2010 Author Share Posted May 8, 2010 it doesn't. is there any other way this can be done? at least a method where the input text is stored in temp file and the file is assigned to variables so I can pass it through the command. I'm sorry if I'm asking something hard. any help is much appreciated. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/200953-text-input-run-perl-script-java-output/#findComment-1054897 Share on other sites More sharing options...
trq Posted May 8, 2010 Share Posted May 8, 2010 it doesn't Can we see this script? is there any other way this can be done? at least a method where the input text is stored in temp file and the file is assigned to variables so I can pass it through the command. You could do that quite easily using file_put_contents. Quote Link to comment https://forums.phpfreaks.com/topic/200953-text-input-run-perl-script-java-output/#findComment-1054898 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.