in reply to matching strings

Why won't this code return when the scalars don't match?

Because you used a "=" instead of an "eq":
You tested wether you could set   $a   to the value of   $aa   instead of making a comparison.
See   perldoc perlintro   and   perldoc perlop  for more.

Cheers, Sören