RFC 192 (v1) Undef values ne value

[email protected] (Perl6 RFC Librarian)
Newsgroups perl.perl6.language,perl.perl6.announce
Message-ID <[email protected]>
This and other RFCs are available on the web at
  http://dev.perl.org/rfc/

=head1	TITLE

Undef values ne value

=head1 VERSION

  Maintainer: Richard Proctor <[email protected]>
  Date: 4 Sep 2000
  Mailing List: [email protected]
  Version: 1
  Number: 192
  Status: Developing

=head1 ABSTRACT

If you compare a variable that is undefined with something, perl winges.
An undefined value is not equal to a string, it should do the right thing.

=head1 DESCRIPTION

Perl winges if you compare an undefined value.  This is silly and one often
has to test for the undefined case (and the empty case for == and !=), then
the equality that the programs logic calls for.  If you leave warnings off
perl does the right thing anyway.

Thus:

  $foo = undef;

  if ($foo ==  1) # should fail the test but not complain
  if ($foo !=  1) # should pass the test, and not complain
  if ($foo eq "bar") # should fail the test but not complain
  if ($foo ne "bar") # should pass the test, and not complain

lt,<,le,<=,gt,>,ge,>= should behave as now, as it is resonable to object
in these cases as the inequality is not well founded.

A comparison between two undefs should (probably) remain an error.


=head1 IMPLENTATION

No idea

=head1 REFERENCES

None yet
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.