in reply to regex format issue

Can you show us the values that are equal but your code shows as different?

Please also show us the relevant part of the code you've written and tell us the exact error message/output you get.

As it is, it is difficult to understand for me where exactly you are having problems. You seem to have code that detects identity when there are no spaces in the product names, but it seems to fail when there is whitespace in the names.

A potential cause for this might be that in the YAML or in the Excel data, there is whitespace at the end of the values.

You can remove whitespace at the end of your values by using:

$value =~ s/\s+$//;