>>
$value =~ s/^the //g;
$value =~ s/^the//g;
<<
I've not read the whole thread so sorry if I'm just leading you astray but:
$value =~ s/^the //g;
$value =~ s/^the//g;
...could be changed to...
$value =~ s/^the\s*//ig;
$value =~ s/^the //g;
$value =~ s/^the//g;
<<
I've not read the whole thread so sorry if I'm just leading you astray but:
$value =~ s/^the //g;
$value =~ s/^the//g;
...could be changed to...
$value =~ s/^the\s*//ig;