in reply to How to get screenshort using PERL?

Have you searched CPAN? There are

which claim to do what you want.

HTH, Rata (who however has not used them yet)