while (<>) { if (/<!-- Begin -->/ .. /<!-- End -->/) { print; } }
Or, more concisely:
(/<!-- Begin -->/ .. /<!-- End -->/) && print while (<>);
See Range Operators in perlref(1) for more information.
In reply to Re: file reading issues
by sgifford
in thread file reading issues
by mojobozo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |