Re^13: Use of uninitialized value in substr
by ikegami (Patriarch) on May 04, 2010 at 00:03 UTC
|
In Perl land, undef is undef is undef....
And I believe differently.
I've been looking for another example, and I can't find one. Do you know of another case where explicit undef or PL_sv_undef is distinguished from undefined?
If there is an example of undef not being undef other than the previously mentioned open hack, it's well hidden. If you believe differently, there's gotta be some obvious example I'm missing.
(Note that I only spoke about the current state of Perl land.)
| [reply] [d/l] [select] |
|
|
f there is an example of undef not being undef other than the previously mentioned open hack, it's well hidden. If you believe differently, there's gotta be some obvious example I'm missing.
undef $foo;
utime $foo, $foo, "file"; # Sets atime, mtime to 00:00:00 Jan 1, 197
+0
utime undef, undef, "file"; # Sets atime, mtime to time().
| [reply] [d/l] |
|
|
And like I said The real question is about making explicit undef semantically different from indirect undef; and therefore making it more powerful, and useful.. It was not about what is, but what could be.
Like I said back here
But it's no big deal. (Really, it isn't).
But what follows that is the crux.
Is substr $x, $start, $end, undef more indicative of deleting the substring than substr $x, $start, $end, '';?
Three extra characters for sure, and I'm rarely in favour of longer over shorter, but in this case I think yes. The consensus appears to be no.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
|
|
Is substr $x, $start, $end, undef more indicative
Not for me (concatenating undef?), but that's definitely subjective. I understand the rationale.
But it's no big deal. (Really, it isn't).
I think it is, because it creates so many questions with no answers. Why does passing undef to substr sometimes give a warning, and sometimes it doesn't? How come lc(undef) gives a warning? How can I pass this special new undef using a variable? etc. Yes, they can be explained, but there shouldn't be a need to.
A solution shouldn't create a host of new problems. Yes, they are small problems, but the gain is even smaller.
| [reply] [d/l] |
|
|
|
|
|
|
Re^13: Use of uninitialized value in substr
by ikegami (Patriarch) on May 03, 2010 at 20:16 UTC
|
it took you this long to get with the program and discuss the actual idea
"Long"? You mean my second post, where I said I didn't like the idea?
And you speak for all "Perl land" do you?
I spoke about all of the Perl code I've seen, which is quite substantial. It goes to show it's not a very Perlish concept.
Update: Added link.
| [reply] |
|
|
| [reply] |
|
|
I've definitely been guilty of that, but not for that node. That sounds like what was in my clipboard buffer. I don't know how you came to see it, but I guess it got fixed when I added the link. I stated the only change I made to that node as I made it. You can see what came of the code in the clipboard over here.
| [reply] |