Monks of Wisdom,

So, after a bit of a break from this to do other work, I'm trying (once again) to resolve the previous issues and now I am seeing some warnings in my output. To my beginners eyes it appears there may a Case issue. I noticed the only difference between the output line that matches and the ones that fail is that the match portion are all numbers. Futhermore, when I checked the data files I noticed the input search strings are in lowercase and the oui strings to match against are in UPPERCASE. Currently using oko1's version of code (shown below) for simplicity. THANKS!
#!/usr/bin/perl -w use 5.010; use strict; my %oui; open my $list1, "ouisample.txt" or die "ouisample.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"; } }
I updated one line and got it to work finally!
(my $temp = uc($2)) =~ tr/.//d;
Thanks a bunch, I'm so excited the script finally works as hoped.

In reply to Re^4: Regex matching part of one hash key to another by KevinNC
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.