in reply to Re^2: Keys() required to autovivify?
in thread Keys() required to autovivify?

Function arguments are always passed by reference, so they need to be real. But print's not a function. Keep in mind that the builtin functions are often called "named operators" and that Deparse shows a "print" op, not a "entersub" op. I suspect it's more along the lines of print and other builtins have their arguments built specially.

Just guessing.

By the way, I was getting similar results to print when using assignments.

Replies are listed 'Best First'.
Re^4: Keys() required to autovivify?
by shmem (Chancellor) on Jan 03, 2008 at 14:19 UTC
    Yeah, but I guess it is the entersub op which forces autovivifying of that undef value into a hash ref, to provide write access. How to verify? "Use the source, luke." ;-)

    That's the sad thing about perl5 - the implementation is the spec. But then it is also its glory, as Abigail puts it:

    Programming in Perl5 is like exploring a large medieval castle, surrounded by a dark, mysterious forest, with something new and unexpected around each corner. There are dragons to be conquered, maidens to be rescued, and holy grails to be quested for. Lots of fun.

    I'll have a bit of fun, when I have time to spend...

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}