Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: print to match multiple pattern

by aitap (Deacon)
on Sep 10, 2012 at 12:43 UTC ( #992747=note: print w/replies, xml ) Need Help??

in reply to print to match multiple pattern

Don't read the whole file into memory. Read it line by line instead:

while (<FILE>) { ... # $_ is the current line }
(see Range operators).

Also, there is no need in the @t array: just slice the array returned by split:

if ((split "\t",$_)[7] =~ /^(?:HIGH|LOW|LRR)$/)

Also, your condition ($t[7] =~ /HIGH/ && /LOW/ && /LRR/) will never be true as long as one line never contains "HIGH", "LOW" and "LRR" at the same time.

Sorry if my advice was wrong.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992747]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2016-10-25 23:54 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (330 votes). Check out past polls.