It would help a lot if we could see some sample input - doesn't have to be the real thing, just the real structure. Meanwhile, just for the heck of it, here's a bit of cleanup for your code. I got queasy looking at all those hard 'or's and square brackets. :)

#!/usr/bin/perl -w use strict; my %oui; open my $list1, "oui.txt" or die "oui.txt: $!\n"; while (<$list1>){ if (/^(.*?) {5}\(base 16\)\t\t(.*)$/) { $oui{$1} = $2; } } close $list1; while (<>){ if (/((?:\d+\.){3}\d+).*([\w.]{14})/i){ (my $temp = $2) =~ tr/.//d; print "$1 mapped to $temp for company ", $oui{substr $temp, 0, + 6}, "\n"; } }
-- 
Education is not the filling of a pail, but the lighting of a fire.
 -- W. B. Yeats

In reply to Re: Regex matching part of one hash key to another by oko1
in thread Regex matching part of one hash key to another by KevinNC

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.