Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
But this works fine.#!/usr/bin/perl use strict; my $count{'abc'} = 0; print "$count{'abc'}\n";
So, why do I have to define %count? Shouldn't my $count{'abc'} have defined %count for me? Isn't this autovivification?my %count; $count{'abc'} = 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Autovivification Confusion
by toolic (Bishop) on Aug 05, 2011 at 18:27 UTC | |
|
Re: Autovivification Confusion
by ikegami (Patriarch) on Aug 05, 2011 at 18:31 UTC | |
|
Re: Autovivification Confusion
by Khen1950fx (Canon) on Aug 05, 2011 at 19:04 UTC | |
by ikegami (Patriarch) on Aug 05, 2011 at 19:32 UTC | |
|
Re: Autovivification Confusion
by Anonymous Monk on Aug 05, 2011 at 18:47 UTC | |
by ikegami (Patriarch) on Aug 05, 2011 at 18:49 UTC |