Replace if (/.../) with while (/.../g) to get all matches. Use parens around what you want to capture. Use $1 to get what's in the parens, not $_.
In this, case you can write it concisely as
while (<FH>) { print( join( "\t", /\w\s+\w+\s+\w+\s+\w+\s+\w+/g ), "\n" ); }
In reply to Re: Howto print multiple matches in a line
by ikegami
in thread Howto print multiple matches in a line
by ashnator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |