I understand that the eq and gt are for string comparisons but why not just use the mathematical ones of == or >. This goes for functions open ... or compared to open .. ||
--As for the rest, it is mine.
Because a string isn't a number.
Sure, you can treat a string as a number, or a series of numbers, based on the ASCII values. But that leads to weirdness and confusion.
For example: The best numeric representation of a string is a _series_ of (ASCII/UTF8/etc) numbers. The numeric comparison operators work on one number on each side. So, how do you convert a string to a single number? Do you add the array together, or work on the first only, or something else?
Ok, so your next objection is that the operator should just know which you mean (numeric or string) and compare using the correct metric. Except, on occasion, you _want_ to compare two strings as if they were numbers. Perl will let you do that. (Even if 'use warnings' will tell you not to.)
As for or vs ||... That is more of a precedence issue at the moment. Note that open ... or would _not_ do the same as open ... ||: The latter would do the comparison before the open. This could be useful: you could make the choice of what to open right then. But it wouldn't be the open ... or die trick we all know and love: for that the open has to be tried first.
In conclusion, Perl has seeming duplicates often because they aren't duplicates, just near-duplicates. Sure, the language could get by with just one. It would just be more work for the programmers.
But why do the programmers want to work?
Daniel T. Staal
--------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>