"Suppose u " read the instrxns around the text entry box: use <code>...</code> tags around code and data.

Since you didn't use code tags around the data, those who try to check your code are at a disadvantage... which is a bad approach when asking for free help.

Then you assure us that the error messages are the "desired output."

So, obviously, problem solved. Moving on...

But maybe that's another mistake... so you get advice from Corion and RichardK to check the content of @t and, specifically, $t[7] which, thus far, you don't appear to have done since you tell us the "data in the 8th column that shows "HIGH", "LOW", "LRR" " but which we can't verify/troubleshooot based on anything you've shown... but which is NOT the case in your sample data, where those strings occur in the seventh column, and should be found in $t[6] if the only problem with your sample data is your formatting and html's rendering of the separators as single spaces.

#!/usr/bin/perl -w use 5.014; #992723 my @temp =<DATA>; my $f=join("",@temp); my @lastreco=split("\n",$f); foreach (@lastreco) { my @t= split("\t",$_); say "testing: $t[6]"; if ($t[6] =~ /HIGH/ && /LOW/ && /LRR/) { print "matched: $1\n"; } } =head unmodified sample data has spaces, not tabs 860414 31 290 28 299 00931.17 HIGH CL1122 860412 501 541 501 554 00977.18 LRR_4 CL0022 860415 501 541 511 564 00977.33 LOW CL0023 =cut __DATA__ 860414 31 290 28 299 00931.17 HIGH CL1122 654321 404 403 402 401 011.1111 ARR34 CL0024 860412 501 541 501 554 00977.18 LRR_4 CL0022 860415 501 541 511 564 00977.33 LOW CL0023 123456 404 403 402 401 011.1111 MED CL0024

Output:

testing: HIGH testing: ARR34 testing: LRR_4 testing: LOW testing: MED

And no, this doesn't address why, even with the corrections above, you're not getting a match... but that answer will be found on numerous (that is, "many," but not "all") nodes here using the term "alternation" or in the documentation for logical operators.


In reply to Re: print to match multiple pattern by ww
in thread print to match multiple pattern by vis1982

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.