Re: Reading uploaded files and text blocks

2004-12-10 Thread John W. Krahn
Jan Eden wrote: Jan Eden wrote on 10.12.2004: I use the following to read in lines from an uploaded file: my $fh = $q->upload('input_file'); while (<$fh>) { push @urls, $_; } It works fine when the file has UNIX or DOS linebreaks, but it fails with Macintosh linebreaks. What is the best method

Re: Reading uploaded files and text blocks

2004-12-10 Thread Jan Eden
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. Th

Reading uploaded files and text blocks

2004-12-10 Thread Jan Eden
Hi, I use the following to read in lines from an uploaded file: my $fh = $q->upload('input_file'); while (<$fh>) { push @urls, $_; } It works fine when the file has UNIX or DOS linebreaks, but it fails with Macintosh linebreaks. What is the best method to read in a Macintosh file (othe

Re: Reading uploaded files and text blocks

2004-12-10 Thread Jan Eden
Jan Eden wrote on 10.12.2004: >Hi, > >I use the following to read in lines from an uploaded file: > >my $fh = $q->upload('input_file'); >while (<$fh>) { push @urls, $_; } > >It works fine when the file has UNIX or DOS linebreaks, but it fails >with Macintosh linebreaks. What is the best me