in reply to Help Me in following code ::

Unrelated to your problem, but will save you lots of typing in the future...

When you need to initialize an array with a range of numbers, you can use Perl's Range Operators:

my @new_lot = 1 .. 186;

It can also be used to create more Perl-ish for loops:

for(my $o = 0;$o<6;$o++){

can also be coded as:

for my $o (0 .. 6){