in reply to Re (tilly) 1: Strange values in hash reference
in thread Strange values in hash reference

Thanks, this totally fixed the problem. New code =

 $$job_hash{'subjects'} =~ s/\r\n/<br>/g;
--
Filmo the Klown

Replies are listed 'Best First'.
Re (tilly) 3: Strange values in hash reference
by tilly (Archbishop) on Aug 15, 2001 at 12:22 UTC
    Be careful. The line endings in your database could be inconsistent. Try:
    s/\r\n?|\n\r?/<br>/g;
    which should work no matter which line ending is in the database whether you are on Windows, Unix, or a Mac.

    If you are (as it looks) trying to define a set of conversions for turning text into somewhat equivalent HTML, you might also want to look at Parse::RecDescent for a much better way to do parsing than just throwing a few regular expressions at it. Or you can go for the hand-rolled version at Why I like functional programming (see the bottom of the thread for a cleaner rewrite through). The rule here could be done by adding the handler

    sub {'<br>'}
    for each of "\r\n", "\n\n", "\r", and "\n". Why would you do that you ask? Well because with that code you can readily implement markup rules based on user defined choices without getting into a mess of custom logic.