Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks, I am in need of a fix for the following. I need to append to the hash as shown. How is this done?
#!usr/bin/perl use strict; use warnings; my %table_hash = ( '0,0' => 'X', '0,1' => 'Y', '0,2' => 'Z', ); print join ",",%table_hash,"\n"; my $n=0; my $m=0; foreach $n (0..3) { $table_hash{'$n,0'} = $m; $m++; }; print join ",",%table_hash,"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding Hash Keys/Values
by kennethk (Abbot) on Nov 08, 2012 at 15:57 UTC | |
|
Re: Adding Hash Keys/Values
by Kenosis (Priest) on Nov 08, 2012 at 15:56 UTC |