Didn't see you also want to filter white space, use this to achieve the whole thing : $data =~ s/[\n\r][\n\r]/<br>/g; # Filters the line breaks $data =~ s/^\s+//; # Filters out white space in front $data =~ s/\s+$//; # Filters out white space in end $data =~ s/\s+/ /g; # Filters out double white spaces and makes it a single space. Maybe that can all be joined a little more, but this is clearer code (I think). Greetz, ThomasThread Previous | Thread Next