I haven't got too much time so a couple of points to start with.

Learn regular expressions. I mean it. They look like a mess to begin with, but I promise, they're SO useful. I don't really use pack/unpack, so this isn't definitive, but I think they're usually used for 'weird' characters and formatting, or manipulating bits. Well, I'm sure many people will argue with 'usually' and tbh, if they can enlighten me on the matter, it'd be useful..!

A quick tip to get you going:

my $text="fakeemail@somewhere.com"; $text =~ /(.+?)@(.+?)/; print "$1, $2"; -------------- fakeemail, somewhere.com
=~ is the regex operator. the groups, indicated with brackets () that you match show up in the variables $1 and $2.

For comma separated values, I would also recommend that you use 'split' as I mentioned before. It's much easier and if the format of your fields change, it won't screw up your program.

@client is an array. A real array. You know it's a real array because you declared it 'my @client'.

\%entry is a hash reference. So you've made an array of hash references. I'm not sure really what they mean by a 'reference array of hashes' but I would interpret it in the way that you have.

why_bird
p.s. I haven't tested the snippets of code here or below, just so you know!
........
Those are my principles. If you don't like them I have others.
-- Groucho Marx
.......

In reply to Re^3: a REFERENCE of array of hashes by why_bird
in thread a REFERENCE of array of hashes by fseng

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.