in reply to Doing a split// but not working

HTTP uses CRLF as line endings (CRLF is the common line ending for network protocols). You're splitting on *either* a carriage return *or* a linefeed. Effectively, you're adding a blank line for each line of input.

Split on /[\n\r]+/ (but this doesn't keep blank input lines), /\r?\n/ (technically not quite correct), or, if you're using 5.10 (and why wouldn't you?), /\R/.

Replies are listed 'Best First'.
Re^2: Doing a split// but not working
by ultranerds (Hermit) on Jan 05, 2010 at 13:21 UTC
    Eugh, turned out was just me being stupid ;) Had this line near the top of the function:
           $message =~ s|\n|<br />|g;

    So what I need to do I should really just do before that regex = )

    Thanks for the help though

    Cheers

    Andy