Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Help with my regex

by cspctec (Sexton)
on Jul 31, 2013 at 21:13 UTC ( #1047315=note: print w/ replies, xml ) Need Help??


in reply to Re: Help with my regex
in thread Help with my regex

I'm not sure how to get "Power State" only without also grabbing "Supported Power State" since they both have the same string in them. I just need the shorter one.


Comment on Re^2: Help with my regex
Re^3: Help with my regex
by Preceptor (Chaplain) on Jul 31, 2013 at 21:25 UTC
    m/^Power State:/

    The ^ is an anchor to 'beginning of line'.

Re^3: Help with my regex
by SuicideJunkie (Priest) on Jul 31, 2013 at 21:36 UTC

    The match in that code above grabs everything up to the first colon. Which means it will get "Supported Power State" on that line, which will then not exist in the hash of things you want. Later it will get "Power State" on the shorter line, and that will exist in the hash of things you want.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2014-12-18 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (61 votes), past polls