// confiure Perl number generator string perlCommand = @"C:\cygwin\bin\perl.exe"; // your Perl string perlScript = "ranArrayGen.pl"; // 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);