PERL script for auto-generating screenshots

There is so many ways to generate screenshots on linux machine, like ksnapshot,
gnome-screenshot etc. There is one more command available is '
import'. It is used for capture some or all of an X server screen and save the image to a file in the system. Try this on your system. On Terminal try:
$ import test.png
You can find that the mouse pointer changes to cross-hair. Draw a rectangle using your mouse, it will captured and saved it to your home directory named test.png. If you try this instead import
root test.png
it will took all the screen and save automatically. From this I  developed a perl script to schedule to get automatic screenshots. Here is the code.