> > Hi, > please can somebody help me and show me the way to access the single attributes for my object...? > I do not have any clue how to handle the array in a hash and so on. > If u want to ask me why I am using it, also I cannot handle it....do not ask...now really I want to use this structure cause it represents to original datarelationship. > But I would be happy for any help provided by u. > > Here is my code example: > sub new > { > my $proto = shift; > my $class = ref($proto) || $proto; > my $self = { > Name => undef, > URLS => [], > Switch => undef, > CodeLine => [ > CodeLineName => undef, > Project => [ > ProjectURL => undef, > ProjectName =>undef, > Logfile =>undef > ]
This last structure, 'Project' doesn't likely do what you want. This should probably be {} instead of []. > ] > }; > bless($self, $class); # but see below > return $self; > } > Generally it helps if you can help us... I would suggest doing a lot of reading, perldoc perldsc perldoc perllol perldoc perlreftut perldoc perlref perldoc perlboot perldoc perltoot Essentially the attributes of your object are referenced through the object like any other hash reference. So the above docs will get you started on the learning path for references, then objects. If you prefer book form the LPORM book from ORA is excellent. I would also suggest becoming acquainted with the Data::Dumper module to help you see visually what your structure really looks like. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>