Thanks to Mr Gregan and Mr Walle for their suggestions for using the
replace operator s///g in perl. Thanks to John Carter for his
constructive criticism and all others who contributed to the discussion.
FYI current code is below,
<snip>
while (<>) {
# if the line is not empty
if (/\S/) {
# if the line starts with whitespace and then a letter
if (/^\s*[a-zA-Z]/) {
} else {
# remove lines that start with (***** )
if (/^\s*\*{5} /) {
} else {
# fix lines with no space preceeding a negative
# number
s/([0-9])(-[0-9])/$1 $2/g;
print;
}
}
}
}
</snip>
Mark