|The stupid question is the question not asked
eq vs. ==by c (Hermit)
|on Jul 20, 2003 at 10:19 UTC
c has asked for the wisdom of the Perl Monks concerning the following question:
In cleaning up some old code recently, I found a string that can be summed up as:
This looked glaringly wrong to me, however it works. In my current perl mindset, I immediately want to change this to:
In my script I am sure that the value of $val will alway be numeric if it is defined at all. However, I'm a bit confused about why == exists if eq works correctly. Reading through perldoc perl, I find the following quote:
So does == exist to present a full list of numeric comparison options, when it, unto itself is not necessary?