[comp.lang.perl] String vs. numeric values

worley@compass.com (Dale Worley) (12/29/90)

   Yes, that gives it a numeric value along with the string value.  Doing
	   1 eq ''
   forces the numeric value to also have a string value.

What I meant was that I expect a variable to have either a string
value or a numeric value, but *never both*.  Basically, this is
because the universe of possible values is the union of two sets: the
set of string and the set of numbers, which are by definition
disjoint.  Perl adds a chameleonlike set of values which have both
string and numeric values simultaneously.

Note that the present system has the curious feature that a variable
can be modified (in a detectable way) by executing the expression
"$a eq ''", which ostensibly only reads the variable.

Also, the predicates "has a numeric value" and "has a string value"
*are not mutually exclusive*, which you will have to state up front in
big letters if people aren't to get confused by it.

Dale Worley		Compass, Inc.			worley@compass.com
--
Be not intimidated, by any terrors, from publishing with utmost
freedom... Nor suffer yourself to be wheedled out of your liberty with
a pretense of politeness, delicacy, or decency.  These, as they are
often used, are but three different names for hypocrisy, chicanery,
and cowardice.		-- John Adams