I've been avoiding regular expression for quite some time because they are eVil but I
have no choice anymore :) Ok, as a warm up script I'm trying to get this working:
replace any matched spaces with
replace a new line with <br>
....
while(<INFILE>) {
s/\s/ /; #replace spaces with
s/\n/<br>\n/; #replace newlines with <br>
print $_;
print OUTFILE $_;
}
....
my problem is when say for example three space are found in a row, perl grabs all
three and replaces them all with one space instead of 3. I think I remember something
about perl being greedy but its been a while.
any help would be ummm, helpful especially on any pointers on better ways to re-write
my crack-hore code :)
Peter