in reply to Mini bash script to perl

A simple way, without any error-handling etc:

system("rm screenlog"); system("tail -n 200 screenlog.0 > screenlog");
You might need to adapt the path to your screenlog-files, however.

HTH, Rata