G'day phantom85,

This is very basic, so I suggest you first acquaint yourself with "perlintro" and the "perldoc Tutorials" (in particular, "perlfaq4").

The data you've provided isn't valid Perl; however, making an educated guess as to what it would really look like, let's say you start with data structures like this:

my $completed_courses = [...]; my $schedule = {...};

The first step would be to create a hash of completed courses. Something like this:

my %completed; for (@$completed_courses) { $completed{$_->{title}} = undef; }

Then, walk through the schedule and remove the completed ones. Something like this:

for (keys %$schedule) { delete $schedule->{$_} if exists $completed{$schedule->{$_}{Course +}}; }

See also: delete and exists.

[Please note that "PerlMonks" is not a code writing service. Refer: "How do I post a question effectively?" and "How (Not) To Ask A Question: Do Your Own Work". Please follow these guidelines if you have follow-up (or unrelated, future) questions.]

— Ken


In reply to Re: comparing hash by kcott
in thread comparing hash by phantom85

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.