in reply to Map a string to an array
This assigns a reference to @arr to $val[0], because $mapp{FirstKey} contains a reference to the array @arr. When you stringify the reference, you get something like "ARRAY(0x7ffafc013bf8)". If you wanted to make @val a copy of @arr, then you can:@val = $mapp{"FirstKey"};
@val = @{$mapp{FirstKey}};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Map a string to an array
by jess195 (Novice) on Nov 01, 2013 at 22:41 UTC | |
by runrig (Abbot) on Nov 01, 2013 at 22:47 UTC | |
by AnomalousMonk (Archbishop) on Nov 02, 2013 at 08:49 UTC | |
by BrowserUk (Patriarch) on Nov 02, 2013 at 10:23 UTC |