in reply to comparing hash
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 +}}; }
[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
|
|---|