Implemented the code and it works but have some more things to be added
foreach $inputline (@input_array) { my @inputline = split(/\|/, $inputline); $inputline[8] = "Other Application event"; my $lastColumn = "#>"; push @inputline, $lastColumn; #Check ETYPE and change EOUTCOME if ($inputline[2] eq 'INFO') { $inputline[5] = "INFO"; } elsif ($inputline[2] eq 'ERROR') { $inputline[5] = "ERROR"; } #Check EMSG and create new field next to it foreach $configline (@cfg_array) { my @configline_array = split(/\|/, $configline); shift @configline_array; for $configitem (@configline_array) { if($inputline[6] =~ $configitem) { my $lastColumn = pop @inputline; $inputline[8] = $configline_array[0]; push @inputline, $lastColumn; last; } } } $line = join('|', @inputline); print $output_fh $line, "\n"; }
if($inputline6 =~ $configitem) { In this line which comparison operator shud be put so that if the string I am searching for is "exception" but the line in the file might contain "MessageException" or "Message.Exception" .So primarily to ignore CASE or it could be part of word. Any help on this??

In reply to Re^2: Regex perl grep usage string match comparison by justinkala
in thread Regex perl grep usage string match comparison by justinkala

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.