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

Allen Day allenday at ucla.edu
Mon Dec 15 15:00:13 EST 2003


Are you sure you want to do that?  Maybe

$line =~ s/^\r// if $^O eq 'MacOS'; #or whatever $^O is for Mac.

is better.

-Allen


On Mon, 15 Dec 2003, Aaron J. Mackey wrote:

> 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
> >
> 
> _______________________________________________
> 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