The code you provided can't be the example taken straight out of Programming Perl, because it doesn't compile. Also, you've mistyped one of the variables. You should always "use strict" and "use warnings" to avoid this kind of thing.
Can't call method "name" on an undefined value at P:\Carnivore\Caymen\struct.pl line 24. -----Original Message----- From: Ed [mailto:[EMAIL PROTECTED] Sent: Monday, April 10, 2006 11:57 AM To: beginners@perl.org Subject: Class::Struct: Can't access struct field elements I'm trying to use the Class::Struct to create some C-Like structs but I'm unable to dereference any array elements in the struct. I'm admittedly a Perl newbie trying to map my C programming experience into Perl so it's possible I'm "thinking in C" rathern than in Perl. I've referenced several texts and web references on the subject and get several ways to create a structure. In each case I'm unable to access any elements in the structures once they are initialized. Here is an example taken straight out of Programming Perl (3rd ed) : <snip example> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>