[tpm] Perl getting the output from .Net apps

Antonio Sun antoniosun at lavabit.com
Fri Mar 16 09:11:17 PDT 2012


Hi,

I bumped into this strange problem that Perl cannot get the output from
.Net apps.

First of all, this is my simple  .Net app written in C#:

--------------------------------------------------
using System;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(DateTime.Today);
        }
    }
}
--------------------------------------------------

It works fine:

ConsoleApp$ bin/Debug/ConsoleApp
3/16/2012 12:00:00 AM

Perl can grab normal program outputs just fine:

$ seq 5 | perl -pe 's/^3$/`date`/e;'
1
2
Fri Mar 16 10:55:46 EDT 2012

4
5

Now it is time to put Perl & .Net app together:

$ seq 5 | perl -pe 's|^3$|`bin/Debug/ConsoleApp`|e;'
1
2

4
5

Boom, it suddenly stops working.

Have you experience something similar before?
What's the solution?


PS. My test run environment is cgwin.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20120316/c2504ea7/attachment.html>


More information about the toronto-pm mailing list