CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
More complex Objects



Dec 20, 2007, 2:53 PM

Post #1 of 3 (637 views)
More complex Objects Can't Post

My understanding is that i have to use array or hash as an internal data structure of my object. I can have another object (or a reference to an object as a part of my hash and it works). However if i want to have another array or a hash as a part of my object i can not store it in my anonymous hash field. For example, field1 of my has will have a string, field2 -> another object or a reference to an object, field3 -> array of strings or objects, field4 -> another hash. Is that possible?
Or do i have to use something like Class::Struct? Is there anything else other then C++ like structs i can use (may be something similar to Java objects)?


Dec 20, 2007, 7:28 PM

Post #2 of 3 (634 views)
Re: [Alexey] More complex Objects [In reply to] Can't Post

What you want to do is possible but you have to learn how to use references in order to create complex data sets. See if this helps you to understand how to construct those data sets using perl:


Dec 20, 2007, 9:19 PM

Post #3 of 3 (632 views)
Re: [KevinR] More complex Objects [In reply to] Can't Post

Thank you. That helped a lot. Now i just will have to decide if it is easier to use Class::Struct or conquer the references Smile


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives