in reply to Retrieving specific word from a line of text.
You just need to capture that section and assign it to the hash. A capture is indicated by parentheses, and the results are stored in $1 - $9. So, try:
if ($_ =~ m/.*(PNODE:\w*)/) # \w* assuming you want alphanumeric chars +. { $PNODES{$1} = 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Retrieving specific word from a line of text.
by CountZero (Bishop) on Dec 11, 2002 at 22:46 UTC |