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

If i have a struct like that
use Class::Struct ; struct works => { 'element' => '%' , 'test' => '@' , 'level' => '$' , }; $test1 = works -> new (); %aa = ( 't1' => 'aaaa' , 't2' => 'bbbb' ); $test1->element(\%aa);
How can i read the element of this class ? ? $test1 -> element() ?

Replies are listed 'Best First'.
Re: How to put and read data type hash in a struct
by iguane (Beadle) on Apr 13, 2001 at 10:24 UTC
    Then after few hour of labor, i find a solution cause the problem has been bad asked.
    In fact the first element must be introduce like that :
    %{$test1->element()} = %aa ;

    we could access to key of hash by using the following typo :
    print $test1->element(aaaa)."\n";