Hmmm... You are right. I have edited my earlier post to correct the misinformation.
It seems that I had confused Perl, SQL, and Lisp while writing that. As I recall, there is only one undef value in perl, and DBI (see also DBI recipes) maps SQL NULL and Perl undef. Here are the tests I ran before writing that post:
$ perl -we 'print "T\n" if "foo" eq "foo"'
T
$ perl -we 'print "T\n" if undef eq "foo"'
Use of uninitialized value in string eq at -e line 1.
$ perl -we 'print "T\n" if undef eq undef'
Use of uninitialized value in string eq at -e line 1.
Use of uninitialized value in string eq at -e line 1.
T
Spotted the missing test yet? Try:
Since the message specifically mentions use of undef in eq, I had assumed that eq actually sees the undefined value, instead of stringifying it like any other value. Wrong!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|