[Bioperl-l] Root::IO handle Mac and Win32 LF

Aaron J. Mackey amackey at pcbi.upenn.edu
Mon Dec 15 14:39:43 EST 2003


If $/ = "\n", then your second regexp won't happen (the \r is at the 
beginning of the next line), right?

So how about instead, simply:

$line =~ s/\r/g; # strip any linefeeds, regardless of position

-Aaron

On Dec 15, 2003, at 1:02 PM, Jason Stajich wrote:

> We currently have this code in Bio::Root::IO to handle stripping 
> linefeeds
> $line =~ s/\r\n/\n/g if( (!$param{-raw}) && (defined $line) );
>
> This only matches Mac LF, to handle windows we need to also strip \n\r
> so I am going to change it to the following:
>
>  $line =~ s/\r\n/\n/g, $line =~ s/\n\r/\n/g
>   if( (!$param{-raw}) && (defined $line) );
>
> Since this is a core critical module wanted to just post it to see if
> anyone has objections/suggestions.
>
> -jason
> --
> Jason Stajich
> Duke University
> jason at cgt.mc.duke.edu
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>



More information about the Bioperl-l mailing list