There are a number of ways to improve your script.
First, always use strictures (use strict; use warnings;). They pick up typos and give early warning of trouble ahead.
Always use the three parameter version of open which gives better security and makes the intent clearer. Check the result of opens and closes - again you get an early heads up about trouble. Use lexical file handles to better manage the life time of the opened file handle.
Never use $a or $b as general purpose variables - they are special and should only be used with sort. In fact, avoid single letter variable names in general - it's too easy to get them confused with each other.
Be consistent with your use of indentation and white space. PerlTidy is a really good tool - use it.
Avoid .*? in regular expressions. Instead use a negated character class: [^\n]*. Only capture stuff you actually want to use - it's more efficient and less confusing.
In reply to Re: content extraction
by GrandFather
in thread content extraction
by zzgulu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |