[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MacPerl cgi-script question



>$string =~ s/\n/<br>/g;
>
>That line of code substitutes all linebreaks with "<BR>" in $string 
>(which consists of the text written in a <textarea> tag). It works 
>fine on UNIX, but not with MacPerl. MacPerl.Specifics says that "\n" on a Mac 
>does not have the same ASCII number as "\n" on UNIX, and that might be the 
>problem here. Anyway, can anyone tell me what that piece of code should look 
>like on a Mac?

Why don't you try something like:

$string =~ s/\$\\/<br>/g

(the $/ variable contains the default input record separator, which is
 probably what you really want)

Glen Osterhout