Here are some pointers:

  1. I didn't see a question 1.
  2. my $numApplepackets= $obj->{records}->{0AA0}->{totalRecords}; is accessing the scalar value held in a hash ref that is nested several levels deep. The entire structure is held in the object reference named $obj. Breaking encapsulization like that isn't a very good object interface for the Fruits class though.
  3. With $fruitobj = $obj->parse0FFA($BananaNum); the Fruits::parse0FFA() function is being used as an object method for the class Fruits's object held as a blessed reference in $obj. The -> operator is dereferencing $obj to access the parse0FFA() sub from package Fruits.
  4. $obj->{$j}->{rxABC} > -100 You're testing whether the value held in $obj->{$j}->{rxABC} is greater than -100.
  5. shift is documented in shift. It shifts a value off of the array passed to it as a parameter argument. If there's no parameter, it shifts off of @_, which is the param list from the sub that it's being invoked within (or @ARGV outside of subs).
  6. my $size = $self->{records}->{0FFA}->{totalRecords} stores a value in $size that is held in the object structure referred to by $self.
  7. $obj->{timestamp} is being assigned a value that is held in $self->{records}->{0FFA}->{$i}->{_timestamp}
  8. ( $tmp, $obj->{$j}->{txABC}, .... ) are being assigned the list of items that are unpacked by unpack.

It probably still doesn't make a ton of sense yet. You're going to need to read the following: shift, unpack, pack, perlpacktut, perlreftut, perldsc, and perlobj, at minimum, before it's going to start becoming clearer. That's several hours of reading material, which will probably need to be broken up into a couple of days. The information is quite dense, and may or may not help the light bulb of understanding to flick on.

A much gentler approach is available: It might be a really good idea to rush over to your local bookstore (or oreilly.com or amazon.com) and pick up a copy of Learning Perl (O'Reilly) and Intermediate Perl (O'Reilly). You'll spend a week or so with each book, and suddenly find yourself able to understand the code posted, as well as a great many other things Perl related.

ps. ikegami is right. StackOverflow is fine for questions that can be answered without a lot of deeper discussion. StackOverflow is not well suited to threaded discussions. When it comes to coaching a person along the learning process, the PerlMonks Monastery is a more flexible environment.


Dave


In reply to Re: I have a perl snippet. And I need help understanding it. Can you help answer these questions. by davido
in thread I have a perl snippet. And I need help understanding it. Can you help answer these questions. by Fighter2

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.