in reply to Re^2: Initializing Hash Arrays in Perl
in thread Initializing Hash Arrays in Perl

Hello winterwind, and welcome to the Monastery!

Re-read davido’s answer, he has explained the use of ++. Although a literal undef++ is a syntax error, that is essentially what is happening here:

12:11 >perl -wE "++$x; say $x;" 1 12:12 >perl -Mstrict -wE "my $x; ++$x; say $x;" 1 12:13 >

This is Perl, it’s a feature! For more on autovivification, see the 2008 thread Explaining Autovivication, and especially Uri Guttman's Tutorial.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,