in reply to how to find out the time taken for a perl program to execute ?

You can use the time function which will give you the system time in seconds. For longer programs this might do, but for very quick programs, you need the Time::Hires module, as blue_cowdawd mentioned.

The perl documentation will tell you how the functions work. Homework for tonight: finding your way through the perl documentation.