I have a Perl script and needed to call a method that's in a .NET assembly. I found this technique but it's quite involved for a one-off Perl script so I didn't use it. I ended up writing a trivial .NET console app as a wrapper for the call I need and have my Perl script communicate with the wrapper, using Console.In / Console.Out / IPC::Open2
.
This turned out to be problematic because .NET's StreamReader.ReadToEnd
method did not seem able to detect the end-of-file on Console.In
, even after my Perl script closed its end of the pipe!
I ended up hacking a solution that worked for my purposes, but is there a better way to call .NET from Perl?