A doubt in using Class::Struct

Hello,

I am trying to use Class::Struct, for creating a structure as follows:

package Classes;
use Class::Struct;
struct(messages => ' [at] ');

$msg = new Classes;
push( [at] abc, "HELLO");
push( [at] abc, "WORLD");
push( [at] abc, "BYE");
$msg->messages( [at] abc);

[at] xyz = [at] {$msg->messages};
foreach $elem( [at] xyz)
{
print $elem ."\n";
}

This gives the following error on compilation:

Too many args to messages at (eval 1) line 17
Classes::messages('Classes=ARRAY(0x8103084)', 'HELLO', 'WORLD',
'BYE')

Also, if I remove the third element of the array, the program compiles,
but I get the following output:
WORLD

The element "HELLO is not displayed.
Can anyone help me with this or let me know what the problem is?

Thanks,
Avi.
none [ Do, 05 Oktober 2006 20:33 ] [ ID #1490403 ]
Perl » comp.lang.perl.modules » A doubt in using Class::Struct

Vorheriges Thema: Which module should I use in order to load files over the internet?
Nächstes Thema: Re: Perl Async .10