chiburashka has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,
i have created a little hash:
my $h = { 'word1'=>[1,2,3,*]; 'word2'=>[4,5,6,7]; };

Now, my question is :
Is there anything that i can put instead of the '*' in the array of 'word1' so that it'll refare(be bounded) to 'word2' ?

Replies are listed 'Best First'.
Re: Hash part linking
by Limbic~Region (Chancellor) on Aug 14, 2004 at 15:14 UTC
    chiburashka,
    Your question is not well worded but I think you want:
    my $h = { word1 => [ 1..3 ], word2 => [ 4..7 ], }; push @{ $h->{word1} }, $h->{word2}; print $h->{word1}[3][3];

    Cheers - L~R

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Hash part linking
by borisz (Canon) on Aug 14, 2004 at 15:19 UTC
    Not sure what you ask for.
    my $h = { 'word1'=>[1,2,3], 'word2'=>[4,5,6,7], }; push @{$h->{word1}}, $h->{word2};
    now $h->{word1}->[3] is a reference to $h->{word2}.
    Boris
    A reply falls below the community's threshold of quality. You may see it by logging in.