peterworth
Programmer
The following code:
gives output:
'SA460EY'
not equal
although clearly the value of $postcode printed IS equal to the one in the if statement. i appreciate its difficult to say whats wrong without seeing the NEEDED file, but for what reasons could these 2 strings not be equal despite appearing to be? could there be some kind of hidden character in there?
thanks.
Code:
foreach $postcode (<NEEDED>)
{
chomp $postcode;
chop $postcode;
print "'$postcode'";
if ($postcode eq "SA460EY")
{
print "\nequal";
}
else
{
print "\nnot equal";
}
}
gives output:
'SA460EY'
not equal
although clearly the value of $postcode printed IS equal to the one in the if statement. i appreciate its difficult to say whats wrong without seeing the NEEDED file, but for what reasons could these 2 strings not be equal despite appearing to be? could there be some kind of hidden character in there?
thanks.