Hi ,

I need to create a class containg the datatypes string,
arrays of objects of other classes and hashes . How do i define all these things in the constructor.

When i create a object i will pass the string datatypes and the array and
hashes would be empty and later on will update the arrays and hashes using the setter fucntions.

Please help me out in creating a constructor which blesses all of the above datatypes.

Most of the tutorials talks about blessing a simple scalar and accessing the same using a function.

Since i have come from Java background my mind is still under pressure to think in perlish way.

Your help would be greatly helpful so that i can keep adding the functionalities over the hint you guys provide.

Thanks !!!!

In reply to Create a class with mutiple datatypes by snra_perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.