in reply to Re: Ant and Perl
in thread Ant and Perl

Hello,

Description:

I'll be building new Java classes for everything else I need to implement. I've already build one class and was able to reference it through ANT. However, there are several Perl scripts I need to launch. I have been unable to get this simple example to work. Is there some trick to getting the CLI options to the perl script you are executing?

Code:

<?xml version="1.0"?> <project name="projectfoo" default="targetfoo" basedir="."> <description> Ant+Perl test </description> <target name="targetfoo" description="launch perl script"> <exec executable="perl"> <arg value="c:\mydir\foo.pl"/> <arg value="-f c:\xyz\filename.txt"/> </exec> </target> </project>
I get the following error:

Output:

Build sequence for target `projectfoo' is targetfoo Complete build sequence is targetfoo

test2:
     exec Current OS is Windows 2000
     exec Executing 'perl' with arguments:
     exec 'foo.pl'
     exec The ' characters around the executable and arguments are
     exec not part of the command.

Thank you :)
-P0w3rK!d

Replies are listed 'Best First'.
Filename separators (was: Ant and Perl)
by lachoy (Parson) on May 31, 2002 at 02:12 UTC

    The fact that the argument regurgitation says foo.pl instead of c:\mydir\foo.pl is a red-flag that some interpolation is going on. Try c:/mydir/foo.pl or c:\\mydir\\foo.pl. Likewise with the other argument.

    Chris
    M-x auto-bs-mode

      That appears to work. However, the output from foo.pl goes into hyperspace... Puzzling... Thank you for your help. :)
      -P0w3rK!d
      Buildfile: build.xml
      
      init:
      
      main:
         mytask Foo...
      
      foo:
      
      BUILD SUCCESSFUL
      Total time: 7 seconds
      

        (Veering OT here...)

        Ant has excellent online documentation for all the core tasks. In particular, check out the output argument in the task.

        Chris
        M-x auto-bs-mode