Output from Perl script in Cygwin

Output from Perl script in Cygwin

3
NewbieNewbie
3

    Jun 21, 2005#1

    I can't seem to capture any output when I run perl scripts under Cygwin.
    I've tried:
    1. Launch ue from cygwin shell
    2. I define a specific cygwin 'perl' with:
    Command line: C:/cygwin/bin/perl %F
    Working Directory: %P
    Create new file: Yes
    Capture output: Yes
    Show DOS box: Yes

    3. Use the alternate output capture option
    4. Run the following simple perl script:
    my @dirs = glob "*.*";
    open OUT , "> ./out";
    print STDOUT "~~ Arrghh! @dirs ~~\n";
    print OUT "~~ Arrghh! @dirs ~~\n";
    close OUT;
    open OUT , "< ./out";
    while (<OUT>)
    {
    print "$_";
    }
    sleep 3;

    The './out' file gets created OK and has the appropriate output. However no output gets captured from the "print STDOUT ..." line.

    If I use ActiveState perl & don't use alternate capture the output *does* get captured.
    I've configured a simple command that uses the cygwin version of 'ls'. Output is captured.

    It appears that there is some problem with the collection of the stdout from a perl script.

    Any ideas?

    Thanks.

      Jun 22, 2005#2

      Well I've managed to answer my own question.

      All I needed to do was:
      1. set up a .bat file to run the cygwin perl e.g.
      @echo off
      C:\cygwin\bin\perl %1

      2. Add a command to run this batch file via tool config
      3. Don't use alternate capture

      & hey presto the output is captured.

      Incidentally it seems to make no difference whether ue is launched from a cygwin shell or not.