Subject: | Failures with Scalar::Properties objects, also dodgy /o on regex |
There is a /o on a pattern match in the module which I believe may cause incorrect operation as the pattern contains an interpolated variable which may vary from one invocation to the next.
Additionally, when making comparisons to Scalar::Properties objects, comparisons break. This may also affect any other classes which overload the numify and/or stringify operations.
I have a combined patch for both, but am loathe to submit it without discussing exactly how S::P objects should be compared to ordinary scalars. The documentation for my patch says:
Note that Scalar::Properties objects are a special case.
If you compare a scalar and a Scalar::Properties, then
they will be considered the same if the two values are the
same, regardless of the presence of properties. If you
compare two Scalar::Properties objects, then they will
only be considered the same if the values and the properties
match. This also applies to Scalar::Properties objects
embedded deep down in nested data structures.