not to do. In Perl, one is one. Value type polymorphism necessarily fails. This is why Perl has two comparison operators and why it is ~~broken [1] .
For example, the scalar returned !0contains three values, one of which is stored as an integer, one is stored as a floating-point number, and one is stored as a string.
For example, a class object package Foo; use overload '0+' => sub { 1 }, fallback => 1;may not contain it at all, but it is considered that it is one of the numeric and string contexts.
- This is why it is still labeled experimental.
source
share