in reply to Re^2: Best way to initialize hash x repetition array?
in thread Best way to initialize hash x repetition array?

The last thing that I'd like to find now is something that automatically generates 0, 0 or 0, 0, 0 ....

[0]{} Perl> print [ (0) x $_ ] for 1 .. 4;; ARRAY(0x36fed28) ARRAY(0x36fecf8) ARRAY(0x36fece0) ARRAY(0x36fecc8) [0]{} Perl> print @{ [ (0) x $_ ] } for 1 .. 4;; 0 0 0 0 0 0 0 0 0 0

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

Replies are listed 'Best First'.
Re^4: Best way to initialize hash x repetition array?
by Veltro (Hermit) on Jun 30, 2018 at 07:28 UTC

    Yes, I already had something like that in my original solution.

    But what I meant was determining the max size to use:

    my $h3_columns = 2 ; # use List::Util qw(max) ; max (each array size) += 2 $hash3{$_} = [ (0) x $h3_columns ] for @keys3_origin ;

    I will find a solution for that, no worries. But that will be after this weekend.