qw> is the "quote words" operator. It lets you do nifty stuff like:

my @foo = qw( key west florida orange juice beverage ); # this is identical to: my @foo1 = ( 'key', 'west', 'florida', 'orange', 'juice', 'beverage', );

See perlop, specifically, the section on Quote and Quote-like Operators" for more info.

You should consider using push instead of recopying the array:

# @incorrect = (@incorrect, $guess); push @incorrect, $guess;

When I was first learning, the single most useful piece of the documentation was the list of functions by category in perlfunc--although I used the version in my copy of Perl in a Nutshell. Anytime I felt like I was doing something awkward or that there might be a better way to do something, I'd look for a built in function to accomplish it.

Useless little toy programs are an excellent way to start. At the beginning of a big project I'll usually build several useless, little toy programs to test my ideas--only I've learned to call the toys "prototypes", because that sounds better. As a beginner, you are building the prototypes for ALL your future programs.


TGI says moo


In reply to Re^3: Control Structure problem, mistake can't be found by TGI
in thread Control Structure problem, mistake can't be found by koolgirl

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.