It works for your test case :)

#!/usr/bin/perl # http://perlmonks.org/?node_id=1196126 use strict; use warnings; my (%waiverhash, @waiverstar); open my $w, '<', \<<END or die; c4a_123,350.00,3300.00,"Justification","Waived,by","Waived,Date","Appr +oved,by","Approved,date" c4emib_*,250.00,2000.00,"Justification","Waived,by","Waived,Date","App +roved,by","Approved,date" END while(<$w>) { my ($name, $target, $adhust) = split /,/; if( $name =~ s/\*/.*/g ) { push @waiverstar, [ qr/^$name$/, $target, $adhust ]; } else { $waiverhash{$name} = [ $target, $adhust ]; } } close $w; while(<DATA>) { my ($name, $target, $adjust) = (split)[1 .. 3]; if( $waiverhash{$name} ) { $target == $waiverhash{$name}[0] and $adjust <= $waiverhash{$name} +[1] and s/VIOLATED/WAIVED/; } else { for my $star ( @waiverstar ) { if( $name =~ $star->[0] ) { $target == $star->[1] and $adjust <= $star->[2] and s/VIOLATED/WAIVED/; last; } } } print; } __DATA__ f1 c4a_123 350.00 3251.94 -2901.94 (VIOLATED) f1 c4b_123 350.00 2419.08 -2069.08 (VIOLATED) f2 c4emib_2060 250.00 2000.00 -1750.00 (VIOLATED) f2 c4emib_2061 250.00 2000.00 -1750.00 (VIOLATED) f2 c4emib_2062 250.00 2000.00 -1750.00 (VIOLATED) f2 c4emib_2063 250.00 2000.00 -1750.00 (VIOLATED) f2 c4emib_2064 250.00 2000.00 -1750.00 (VIOLATED) f2 c4emib_2065 250.00 2000.00 -1750.00 (VIOLATED)

In reply to Re: Wildcard in a hash by tybalt89
in thread Grep asterisk sign in input file by DespacitoPerl

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.