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; }
In reply to Re: Retrieving specific word from a line of text.
by djantzen
in thread Retrieving specific word from a line of text.
by gnu@perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |