Jan Eden wrote on 10.12.2004:

>I am also a little confused about which line endings come with text uploaded 
>via 
>a textarea. I use:
>
>    my $input = $q->param('input');
>    $input =~ s/[\r\n]{2,}/\n/g;
>    my @urls = split /\n/, $input;
>
>to make sure I have not more than one linebreak. This works. But this also 
>works:
>
>    my $input = $q->param('input');
>    $input =~ s/[\n]{2,}/\n/g;
>    my @urls = split /[\r\n]+/, $input;
>
>Note that I use a simple \n now in line 2 and the character class in line 3. 
>But 
>some mixtures of these two versions do not work.

I was able to sort this question myself. I only need

my @urls = split /[\r\n]+/, $input;

since it takes all possible combinations of linebreaking characters and splits 
on them.

Now it is just the linebreaks within the file which remain a problem for me.

Thanks,

Jan
-- 
How many Microsoft engineers does it take to screw in a lightbulb? None. They 
just redefine "dark" as the new standard.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to