Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Help with my regex

by Laurent_R (Abbot)
on Jul 31, 2013 at 21:51 UTC ( #1047319=note: print w/replies, xml ) Need Help??


in reply to Help with my regex

You could also exclude lines that you don't want:

my $match = 'status|power'; foreach (@data) { next if /NCQ/ or /Supported/; print $_ if /$match/i; }

Or even simpler:

foreach (@data) { print unless /NCQ/ or /Supported/ or /^$/; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047319]
help
Chatterbox?
[LanX]: yet another reason to miss yapc na this year
[shmem]: missing is an euphemism
[Discipulus]: a piano et¨de can be harmfull, anyway
[shmem]: grandola vila morena *sing*

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-04-29 22:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (534 votes). Check out past polls.