Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^3: The Bad, the Ugly, and the Good of autovivification

by Anonymous Monk
on Apr 08, 2005 at 14:51 UTC ( #446028=note: print w/replies, xml ) Need Help??

in reply to Re^2: The Bad, the Ugly, and the Good of autovivification
in thread The Bad, the Ugly, and the Good of autovivification


I don't get your point. open could cause havoc as well if you've botched up the second argument (or third if you use three arg open). Is that the fault of open? If you match a regex against a string you've botched up, you get the wrong result. Does that mean matching has an "ugly" side? If you pass in the wrong arguments, most functions will do the wrong thing - but that's not the fault of said function. It's the fault of the caller of said functions.

Let me quote an early computer pioneer:

On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.

Charles Babbage

  • Comment on Re^3: The Bad, the Ugly, and the Good of autovivification

Replies are listed 'Best First'.
Re^4: The Bad, the Ugly, and the Good of autovivification
by tlm (Prior) on Apr 08, 2005 at 16:26 UTC

    Well, I'm beginning to repeat myself, so this will be my last attempt. The post from the start was a comment on how the standard sources of Perl documentation give short shrift to the issue of autovivification-related bugs, and that this is something that should be corrected (either that, or change the way Perl autovivifies to eliminate the most common of these bugs). The Perl documentation would be perfectly accurate, but much less useful, if it limited itself to describing how things work without ever mentioning pitfalls. You conveniently give the example of open: well, the Perl docs are rife with admonitions against failing to check the return value of open. There should be similar warnings about autovivification bugs. At the very least they deserve an entry in perltrap, and a pointer to this entry in perlref, and even also in perlreftut

    the lowliest monk

      Patches welcome.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://446028]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2020-06-06 09:25 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (41 votes). Check out past polls.