Since you described this as your first Perl program, let me comment on your loop. The others have given good advice for the data structures, so I'll just make a quick suggestion about your actual code.

You have:

$n == 0; for (loop condition){ $n++ }
for my $Idx (0 .. $#combo){ print "SKUID:$skuid[$Idx]\n"; print "NAME:$name[$Idx]\n"; print "PRICE:$price[$Idx]\n"; }
In other words, for each index in @combo (the 0 .. $#combo part), set $Idx to that index and run the body of the block. This accomplishes the same thing as your code, but doesn't leave an unused variable ($n) lying around. It specifically uses the index of each element in @combo, which makes the code easier to follow and maintain. Besides, it looks so much cooler... ;-)

Welcome to Perl in general and Perl Monks in specific. We're glad to have you.

Russ
Brainbench 'Most Valuable Professional' for Perl


In reply to Re: Perplexed Winemaking Monk by Russ
in thread Perplexed Winemaking Monk by bini

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.