in reply to hash to text
So my question is how to make that output look normal(like what it's supposed to be) ?
What ARE you expecting $h{word2} to contain, [[2,3],3] or [2,3,3] ?
Does this make you any wiser or perhaps you ought to check out the docs?
#!perl -w use strict; my %h = ( word1 =>[2,3], word3 =>[1,2] ); $h{word2} = [ $h{'word1'},3], $h{word4} = [ @{ $h{'word1'} },3], print $h{'word2'}->[0]->[0], "\n"; # Alternative1 print @{ @{ $h{'word2'} }[0] }[0], "\n"; # Alternative1 print @{ $h{'word4'}}[0], "\n"; # Alternative2 print $h{'word4'}->[0], "\n"; # Alternative2 __OUTPUT__ 2 2 2 2
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: hash to text
by chiburashka (Initiate) on Aug 14, 2004 at 21:19 UTC | |
by Velaki (Chaplain) on Aug 14, 2004 at 22:02 UTC | |
Re^2: hash to text
by chiburashka (Initiate) on Aug 14, 2004 at 20:56 UTC |
In Section
Seekers of Perl Wisdom