in reply to Exploiting Perls idea of what is a number
If you approach the equivalence from the other direction, it becomes easier:
Two strings are equal iff
When described that way, the expression becomes:
$a eq $b || $a == $b
This has the small drawback of equating undef and the empty string with 0 as well though.
Update It also has the other small drawback of considering all strings to be equal, which is a bit suboptimal...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exploiting Perls idea of what is a number (oops)
by tye (Sage) on Jul 08, 2008 at 12:57 UTC | |
by jettero (Monsignor) on Jul 08, 2008 at 13:12 UTC | |
by rovf (Priest) on Jul 08, 2008 at 14:50 UTC | |
by tye (Sage) on Jul 08, 2008 at 15:22 UTC | |
by ikegami (Patriarch) on Jul 09, 2008 at 04:15 UTC | |
by rovf (Priest) on Jul 09, 2008 at 06:49 UTC | |
|
Re^2: Exploiting Perls idea of what is a number
by rovf (Priest) on Jul 08, 2008 at 13:11 UTC | |
|
Re^2: Exploiting Perls idea of what is a number
by rovf (Priest) on Jul 08, 2008 at 12:56 UTC |