You can run external programs from C#, a quick Google brings up, for example, this. You would be calling perl.exe (or wperl.exe) with the appropriate arguments, i.e. the pathname of your script and any other arguments.

I've found it's helpful to use absolute pathnames, and also to write the script such that it does not make any assumptions about the current working directory (it can use FindBin to figure out its location). A caveat: Using full pathnames means that those need to be hardcoded or configured, making the application a little less easy to move between differently laid out machines. I've found that in a somewhat controlled environment, full pathnames have been more helpful than not, others may disagree.

As for really "integrating" Perl into C#, as in integrating an interpreter into your application, I'm not sure if that's possible or how easy or not it is. Maybe some other Monks have some experience on that. Apparently ActiveState offers some kind of .NET "integration".

Lastly, as the other anon has pointed out, you can write GUIs in Perl (but then they wouldn't have anything to do with C#).


In reply to Re: Calling Perl script from windows form by Anonymous Monk
in thread Calling Perl script from windows form by Yona

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.