I would do this only for displaying, not when saving the data. You should really save the data without html formatting, and then format it for display. This makes it easier when you need to put it into a form field, or perhaps email the data.
You could do all the fields like:
foreach ($in->param) {
$val = $in->param($_);
$val =~ s/\n/<br>/g;
$in->param($_, $val);
}
assuming you wanted to do it for a CGI object. If it's just in a hash:
foreach (keys %in) {
$in{$_} =~ s/\n/<br>/g;
}
Hope that helps,
Alex
You could do all the fields like:
foreach ($in->param) {
$val = $in->param($_);
$val =~ s/\n/<br>/g;
$in->param($_, $val);
}
assuming you wanted to do it for a CGI object. If it's just in a hash:
foreach (keys %in) {
$in{$_} =~ s/\n/<br>/g;
}
Hope that helps,
Alex