in reply to Ant, Perl, and where did my STDOUT go?

I don't know if this is a Win32 thing, because the following works for me:

Buildfile build-perl.xml:

<project name="mytest" default="run_perl" basedir="."> <target name="run_perl" description="Test STDOUT"> <exec executable="perl" dir="${basedir}"> <arg value="foo.pl"/> <arg value="-h yes"/> </exec> </target> </project>

Script: foo.pl

#!/usr/bin/perl use strict; use Getopt::Std; my %opts = (); getopt( 'h', \%opts ); if ( $opts{h} ) { print "Printing help..."; } else { print "No help requested, none given."; }

Running it gives me:

[wintercm@juvenile test]$ ant -buildfile build-perl.xml Buildfile: build-perl.xml run_perl: [exec] Printing help... BUILD SUCCESSFUL Total time: 2 seconds

And if I comment out the second argument from the exec task, I get:

[wintercm@juvenile test]$ ant -buildfile build-perl.xml Buildfile: build-perl.xml run_perl: [exec] No help requested, none given. BUILD SUCCESSFUL Total time: 2 seconds

...which is exactly what I'd expect. Try running this on your machine to see what happens. If it doesn't work, look into the docs to see if Ant on Win32 does anything funky with STDOUT.

Chris
M-x auto-bs-mode