
KeithBoynton
New User
Feb 25, 2004, 3:27 PM
Post #1 of 3
(510 views)
|
|
A simple hash and arrays problem?
|
Can't Post
|
|
A simple problem very probably: I can define an hash containing an array like this (and it works fine):
my @array=('one','two'); my %hash= ( 1 => { 'Name' =>Something', 'Root' =>'Something else' }, 2 => { 'Name' =>'Something Again', 'Root' =>'Something else ..', 'anArray' => \@array } ); Yet if I try to define it like this, it doesn't work:
my %hash= ( 1 => { 'Name' =>Something', 'Root' =>'Something else' }, 2 => { 'Name' =>'Something Again', 'Root' =>'Something else ..', 'anArray' => \('one','two') } ); Any ideas why this doesn't work and how I should be doing it? Thanks in advance :)
|