Hello, I have an array of hash and hash of hashes that I want to compare

Array:

completed_courses = [ { 'type' => 'core', 'name' => 'Discrete Structures', 'title' => 'CS 130' }, { 'type' => 'core', 'name' => 'Intro to Computer Science', 'title' => 'CS 140' }, { 'type' => 'core', 'name' => 'C++ Programming', 'title' => 'CS 256' } ];
Hash:
schedule = { 'CS 130 Section 01' => { 'Course' => 'CS 130', 'Time' => '8:00 AM - 9:00 AM', 'Class number => 35465, 'Room' => 8 302' }, 'CS 140 Section 01' => { 'Course' => 'CS 140', 'Time' => '8:00 AM - 9:00 AM', 'Class number => 35465, 'Room' => 8 302' }, 'CS 256 Section 01' => { 'Course' => 'CS 256', 'Time' => '8:00 AM - 9:00 AM', 'Class number => 35465, 'Room' => 8 302' }, 'CS 241 Section 02' => { 'Course' => 'CS 241', 'Time' => '8:00 AM - 9:00 AM', 'Class number => 35465, 'Room' => 8 302' }, }
I want to compare and remove the entry from schedule if the title in completed courses is same to Course in schedule. So after comparing the schedule should look like this.
schedule = { 'CS 241 Section 02' => { 'Course' => 'CS 241', 'Time' => '8:00 AM - 9:00 AM', 'Class number => 35465, 'Room' => 8 302' }, }
Any ideas on how to achieve that would be appreciated thank you.

In reply to 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.