Dude, you've completely missed the point (again). No where did I propose making "0" and "undef" the same concept. All I want is to change the default STRINGIFICATION BEHAVIOUR of undef. Since you seem to be misunderstanding that, that means what happens when "undef" is interpolated inside a string. Currently when undef is interpolated inside a string it changes to ''. I want it to instead render as '0'. I'm not changing the fundamental concept of undef, just a display aspect of it.

Perhaps an example will illustrate my point. $u = URI->new('http://google.com'); $u is now a URI object. It's not a string containing a url, but when I interpolate it inside a string, it appears as a string containing a url. It's still a URI object, but it's rendered as a string.

As for breaking other modules, well, I have trouble believing that theres that many modules that test the stringification of undef if they wanted to test for undef, but even so, obviously the solution would have to be modular so it only applied to the current scope. use warnings; Would break far more code if it was indiscriminately applied to every module you used.

In reply to Re: Re: Re: Re: Stringifying undefs by BUU
in thread Stringifying undefs by BUU

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.