P0w3rK!d has asked for the wisdom of the Perl Monks concerning the following question:
I recently coded up some Java classes to extend the functionality of the Task class within Ant. One of the tasks is a Perl script which allows for command line options. I created the execute() method within my task to call the Perl script. Since I am not done completely coding all the methods in the class yet, I am directly passing in the "-h" command line option to invoke help. Here is the code:
public void execute() throws BuildException { Commandline commandLine = new Commandline(); Project aProj = getProject(); int result = 0; // build the command line from what we got the format is // perl foo.pl [options...] commandLine.setExecutable(getFooCommand()); commandLine.createArgument().setValue(COMMAND_FOO); commandLine.createArgument().setValue("-h"); // Check the command line options checkOptions(commandLine); // For debugging System.out.println(commandLine.toString()); result = run(commandLine); if ( result != 0 ) { String msg = "Failed executing: " + commandLine.toString() +; throw new BuildException(msg, location); } }
When the script executes, none of the output from the Perl script is appearing on the screen. If I invoke the script from the command line:
C:\>perl foo.pl -h
it works fine and the output displays to the screen.
Does anyone know where my STDOUT went?
Thank you :)
P0w3rK!d
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ant, Perl, and where did my STDOUT go?
by Abigail-II (Bishop) on Jun 04, 2002 at 15:01 UTC | |
by P0w3rK!d (Pilgrim) on Jun 04, 2002 at 15:19 UTC | |
|
Re: Ant, Perl, and where did my STDOUT go?
by lachoy (Parson) on Jun 04, 2002 at 15:20 UTC | |
|
Re: Ant, Perl, and where did my STDOUT go? (Correction)
by P0w3rK!d (Pilgrim) on Jun 04, 2002 at 15:01 UTC |