Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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.


Comment on Re: print to match multiple pattern
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2014-07-30 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls