Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You don't specify what's wrong, so I can only guess: I'm thinking that line 15 should be: $details{'Main Memory'} = $1 if (/^\S+ Intel (\S+)/i);You have only one capture group (i.e., part of the regular expression inside parenthesis), so the captured value can only be in $1. For example:
when you run it, you should get:
In order to get better answers, it's helpful to include a bit more information. Especially if you can make a simple bit of code that can demonstrate the problem as I just did here. I hope I guessed correctly, but if not, update the code in your original question to make it clear. You could do so by putting something like:
at the front, and something like:
at the end to show what you actually get. Then specify what you actually wanted instead, so we can clearly see the problem. Note the angle brackets I put in the output: whitespace handling errors (especially newlines and carriage returns) are so common that it's helpful to put something before and after the string so you can see if there are unwanted characters in your output. ...roboticus When your only tool is a hammer, all problems look like your thumb. In reply to Re: Parse variables from @output
by roboticus
|
|