I have found this script in the unity scripting reference, and would like to know what i should have this .pl script as. I do not know python so if anyone could help that would be great.
// Grab a screen shot and upload it to a CGI script.
// The CGI script must be able to hande form uploads.
var screenShotURL= "http://www.my-server.com/cgi-bin/screenshot.pl";
// Take a screen shot immediately
function Start() {
UploadPNG();
}
function UploadPNG() {
// We should only read the screen after all rendering is complete
yield WaitForEndOfFrame();
// Create a texture the size of the screen, RGB24 format
var width = Screen.width;
var height = Screen.height;
var tex = new Texture2D( width, height, TextureFormat.RGB24, false );
// Read screen contents into the texture
tex.ReadPixels( Rect(0, 0, width, height), 0, 0 );
tex.Apply();
// Encode texture into PNG
var bytes = tex.EncodeToPNG();
Destroy( tex );
// Create a Web Form
var form = new WWWForm();
form.AddField("frameCount", Time.frameCount.ToString());
form.AddBinaryData("fileUpload", bytes, "screenShot.png", "image/png");
// Upload to a cgi script
var w = WWW(screenShotURL, form);
yield w;
if (w.error != null)
print(w.error);
else
print("Finished Uploading Screenshot");
}