in reply to Quick and portable way to determine line-ending string?
This assumes that the file will not contain an 0x0a or 0x0d unless it is used as part of the newline, which should be true of a textfile.sub seperator { my $cr = chr(0x0d); my $lf = chr(0x0a); if($_[0] =~ /([$cr$lf]+)/o) { return $1; } #unable to find seperator, handle error here. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Quick and portable way to determine line-ending string?
by bikeNomad (Priest) on Aug 09, 2001 at 02:59 UTC | |
by tye (Sage) on Aug 09, 2001 at 05:12 UTC | |
by nardo (Friar) on Aug 09, 2001 at 03:38 UTC | |
by John M. Dlugosz (Monsignor) on Aug 09, 2001 at 07:10 UTC |