Click here to get back home

A doubt in using Class::Struct

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
A doubt in using Class::Struct None 10-05-2006
Posted by None on October 5, 2006, 2:33 pm
Please log in for more thread options


Hello,

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

package Classes;
use Class::Struct;
struct(messages => '@');

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

@xyz = @;
foreach $elem(@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.


Similar ThreadsPosted
Perl Class::Struct October 13, 2005, 3:18 am
Class::Struct - want to access structure within structure April 29, 2006, 3:33 pm
Class::DBI::Schema2Code V 1.01 July 29, 2004, 7:14 am
Class::Tree V 1.24 July 29, 2004, 7:15 am
[RFC] Class::DataStore May 13, 2005, 2:45 pm
RFC: new module Class::MakeIntrospecMethods October 18, 2004, 4:30 pm
[ANNOUNCE] New module Class::IntrospectionMethods December 6, 2004, 2:12 pm
Class::MethodMaker v2 syntax help requested February 7, 2005, 9:33 pm
Namespace for MMS Parser class and a request for help August 13, 2005, 8:43 pm
Class::Std causing compilation errors November 24, 2007, 5:08 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap