Added functionality to the test.pl script