You really need to review how data in perl works--you're not going to figure it out by hacking on the keyboard.

A couple procedural hints:

For example, here's a little program you could have written to investigate hashes. Once you understand how it works, it'll be easier to work on your project.

$ cat t.pl #!/usr/bin/perl use strict; use warnings; use Data::Dumper; # some data to stick into the hash my $string1 = 'a'; # randomly generated my $string2 = 'f'; # randomly generated my $string3 = 'l'; # randomly generated my $string4 = 'g'; # randomly generated # stick them into the hash my %hashCheckLetter; $hashCheckLetter{$string1}=0; $hashCheckLetter{$string4}=0; $hashCheckLetter{$string3}=0; $hashCheckLetter{$string2}=0; # What does the hash actually have in it? print Dumper(\%hashCheckLetter); # what letters are in the hash? for my $letter ('a' .. 'h') { if (exists $hashCheckLetter{$letter}) { print "Found $letter!\n"; } else { print "Letter $letter not available\n"; } }

When run, it produces this:

$ perl t.pl $VAR1 = { 'l' => 0, 'a' => 0, 'g' => 0, 'f' => 0 }; Found a! Letter b not available Letter c not available Letter d not available Letter e not available Found f! Found g! Letter h not available

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re^7: Need help with Peal! by roboticus
in thread Need help with Peal! by ivanzhibin

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.