Hi Thanks for suggestion. But the problem is that how can i store the elements in an array printed by the following line print "$_\n" for @{ $blocks[0] }; and send them to a sub routine present in another module and when that module returns 1, then it will stores the elements printed by the following line print "$_\n" for @{ $blocks[1] }; and send them to that sub routine present in that particular module and when that module returns 1, then it will send the elements printed by the following line print "$_\n" for @{ $blocks[2] }; and so on. Lastly the program will exit when if there is no ITEM.