#!/usr/bin/perl -w use strict; my %hints; open FILE, 'hints'; while () { chomp; my @hint = split(/\s*==\s*/); $hints{$hint[0]} = $hint[1]; } close FILE; my $filename = 'file'; open FILE, $filename; binmode FILE; { local $/; my $file = ; print map { $file =~ /$_/ ? $hints{$_} : () } keys %hints; } close FILE;