sub text_to_html_value { my ($s) = @_; $s =~ s/&/&/g; $s =~ s/"/"/g; return qq{"$s"}; } my $q_value = text_to_html_value($value); print qq{};