You have some quoting issues in your post, so I've reposted the whole thing here, along with a solution. I'm in between painting my place so I didn't have much time to make it more efficient, so here's a way to do it that could use some help in the efficiency department:

update: ++ kcott /update

use strict; use warnings; use Data::Dumper; my $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' } ]; my $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' }, }; for my $done (@{ $completed_courses }){ my $title = $done->{title}; for my $section (keys %$schedule){ if ($schedule->{$section}{Course} eq $title){ delete $schedule->{$section}; } } } print Dumper $schedule;

Output

$VAR1 = { 'CS 241 Section 02' => { 'Class number' => 35465, 'Room' => '8 302', 'Course' => 'CS 241', 'Time' => '8:00 AM - 9:00 AM' } };

In reply to Re: comparing hash by stevieb
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.