in reply to "Err:Use of uninitialized value in string eq" while using split

You aren't chomping the lines from B.out as you read them so the newline is still on the end. The assertion \s includes newlines, so the split is returning everything after the newline as the last item in the array @temp1. But there isn't anything after the \n, so the last item in the array is null value, hence the uninitialized string warning.

The fix? chomp the lines as they are read in.

Update I read the script a little closer. Right effect, wrong reason. Any blank lines in B.out will be completely cleared by /\s+/ so the array will just contain null values. / +/ will leave the \n in the array so the string comparison won't complain.