For the benefit of those who didn't get to see the original post of this question

I was confused about the movement of the actual data and how it is accessed in sub-routines within a package.

I was also confused about the structure/style I could use to write code that I didn't have to continually use my within those sub-routines, since the constructor created those variables to start with. This was answered by kyle with a simple change of scope, or the use of $self->{variable}.

The second part of the node is still up for grabs as far as a good visual for the arrangement of data flowing to the package.

The reason for this question is: When I use sub-routines in a package. If I wanted to get the value that was passed, I had to use the my $var = shift;, otherwise, the value passed didn't get assigned. So to clarify -- the question really is; What are we shifting?

I believe it is the array @_ .

Any pointers to docs, or answers will be greatly appreciated.

If there is a way that one of you gurus could help draw a simplistic picture of a few things in OOP Perl, it would be wonderful.

Since Kyle showed me the visual for encapsulation, Thanks Kyle!

I am still pondering the visual on the look of the data as if it were maybe an array like so:

information_heading_to_server{Classname, first_piece_of_data, second_piece, third_piece}.

This may seem trivial, but it helps me to understand the

my $self = shift; followed by my $whatever = shift;

I get the self shift call to handle the first argument being the classname, but what about the others? Is the classname also the first element there too?


In reply to Something I'd really like to know about OOP Perl. by Sagacity

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.