The last also fixes the (presumed) problem of looping through the whole file even after you've found the relevant section. Notice the \b too which I forgot.while (<FOO>) { print if /Port\s+$port\b/ .. /^#---/ && last; }
In reply to Re: Re: Re: Help Matching Sections of a file
by TilRMan
in thread Help Matching Sections of a file
by smaida
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |