Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Calling a perl test script from visual studio?

by ba1688 (Novice)
on Feb 28, 2014 at 13:27 UTC ( #1076528=perlquestion: print w/replies, xml ) Need Help??
ba1688 has asked for the wisdom of the Perl Monks concerning the following question:

So I have a perl script that runs a bunch of input scripts into this solution I have in VS Studio. Basically I don't want to leave VS Studio anymore and I just want to run this perl script from VS Studio while I'm in my solution. Anyone know how I can?
  • Comment on Calling a perl test script from visual studio?

Replies are listed 'Best First'.
Re: Calling a perl test script from visual studio?
by davies (Parson) on Feb 28, 2014 at 16:10 UTC
Re: Calling a perl test script from visual studio?
by Jenda (Abbot) on Feb 28, 2014 at 22:52 UTC

    So just add it in Tools / External Tools. You can run whatever you like from the Tools menu.

    Enoch was right!
    Enjoy the last years of Rome.

Re: Calling a perl test script from visual studio?
by dbuckhal (Pilgrim) on Feb 28, 2014 at 20:42 UTC

    What language are you using in Visual Studio?

    For ProjectEuler Problem 11, I wrote a solution in C#, as well as Perl. Then I thought it would be interesting to use Perl to generate a n x n random number array for the C# program.

    So, I browsed around and found an example to execute Perl from within C# code. It then stores the array in "data" for C# to process.

    Maybe this might be something of use to you?

    // confiure Perl number generator string perlCommand = @"C:\cygwin\bin\perl.exe"; // your Perl string perlScript = ""; // your script // how big of array ( default = 20 x 20 ) Console.Write("Enter desired array size [20]: "); string perlArg = Console.ReadLine(); int readInt; if ( !int.TryParse( perlArg, out readInt ) ) perlArg = "20"; // setup process info for script ProcessStartInfo perlStartInfo = new ProcessStartInfo(perlCommand); perlStartInfo.Arguments = perlScript + " " + perlArg; perlStartInfo.UseShellExecute = false; perlStartInfo.RedirectStandardOutput = true; // execute Perl number generator Process perl = new Process(); perl.StartInfo = perlStartInfo; perl.Start(); string data = perl.StandardOutput.ReadToEnd(); perl.WaitForExit(); perl.Close(); // display working array data Console.WriteLine("Using:\n{0}", data);

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1076528]
Approved by Corion
Front-paged by GotToBTru
[tye]: 1) The python stack traces show you the names of variables, not the values of variables. Almost never informative.
[LanX]: do you have a py job now?
[tye]: Right now I have errors trying to fetch stuff from graphite. It says 'apps not ready, check startup logs'. I eventually find the startup logs and see 'no apps found'. Looking for fixes to this problem...
[LanX]: no idea ... ask py monks! ;-p
[tye]: it turns out that this can be caused by almost anything going wrong. If you want to know what caused the problem, you have to try to load each app by-hand to see what problems it is having, because none of those will be logged.
[tye]: No, I write more Perl than py at work. But I have to deal with plenty of py things.
[tye]: py monks would just be offended.
[Corion]: ;)
[Corion]: Hi tye btw ;)
[Corion]: I found plenty of not chatty enough logs with Perl too ... I'm slowly coming to appreciate Log::Log4perl resp. our homegrown alternative

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-09-21 20:11 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (252 votes). Check out past polls.