On Thu, Feb 06, 2003 at 10:56:06AM -0500, Joel Gwynn wrote:
Wow. This is driving me crazy. I'm looking for a value in one of the
keys in a hash, like so:
[...]
Now, what's driving me crazy is that the two test values are being added
to the hash, simply by looking for $apples{$t}{weight}.
ARJB == Anthony R J Ball [EMAIL PROTECTED] writes:
ARJB It is called auto-vivification, and you can't avoid it.
ARJB If you look at a hash of a hash that doesn't exist, perl
ARJB creates the lower hash, rather than giving you an error
ARJB for trying to access a hash that does not
DB == Dan Boger [EMAIL PROTECTED] writes:
DB aren't you auto-vivifying the hash keys, are you're looking them up? by
DB checking the value of $apples{crabapple}{weight} you are automatically
DB creating those keys. perhaps 'exists' would avoid that? or you could
DB check the existance
Uri,
Perhaps you could supply some code that
would clarify your position.
Here's my complete script:
#!/usr/local/bin/perl -s
use strict; use warnings;
use Data::Dumper;
my %apples =
(
macintosh =
{weight = '10lb', cost = '5'},
red_delicious =
{weight = '15lb', cost = '2'},
Joel Gwynn wrote:
Thanks all for the explanation, and to Uri for the article, but
especially to Greg, who has given perhaps the most cryptic and
disturbing intro to a technical explanation ever:
you've glimpsed the dark side of autovivification.
way back when, back before perl was even a
[EMAIL PROTECTED] wrote:
Do What I Mean and
Autovivification
aren't what I wanted.
Hm, though technically accurate in Joel's
situation, I think it would be better
if I generalize it to be more universal,
rather than worry about it being taken
out of context. Therefore:
Do What I Mean and
Actually the best poetic form to feature the
word autovivication
would seem to be the Double Dactyl see
http://lonestar.texas.net/~robison/dactyls.html
http://www.kith.org/logos/words/lower/d.html etc.
e.g. the self-describing
Higgledy-Piggledy
Dactyls in dimeter,
Verse form with choriambs
i got burned on this too. there is another syllable some of you are
missing.
the word root is vivify. so don't drop the 'fy' part. just prefix auto-
and convert the 'y' to 'ication'
autovivification
:)
uri
--
Uri Guttman -- [EMAIL PROTECTED]
On Thu, 6 Feb 2003, Uri Guttman wrote:
i got burned on this too. there is another syllable some of you are
missing.
the word root is vivify. so don't drop the 'fy' part. just prefix auto-
and convert the 'y' to 'ication'
autovivification
:)
To be fair though, I think this was a
hm. My original haiku was correct.
[EMAIL PROTECTED] wrote:
Do What I Mean and
Autovivification
aren't what I wanted.
believe me, I counted syllables
about twenty times just to make sure
it had 7. Thank god there weren't more
than seven, cause I'm not sure legal
haiku syntax allows
On Thu, 6 Feb 2003 [EMAIL PROTECTED] wrote:
- Do What I Mean and
- Autovivification
- can be unwanted
Do What I Mena and
Autovivication can
also be misspelled.
:)
--
Chris Devers[EMAIL PROTECTED]
thread, n.
1 A poor but honest process trying to survive in a hostile environment.
2
11 matches
Mail list logo