[EMAIL PROTECTED] (Brad Baxter) writes:
> Re:
> >   crlf     => sub { s/[$dos$mac$unix]+/$myPlatform/og },
> 
> Three (hair-splitting) questions:
> 
> 1. Isn't [$dos$mac$unix]+ going to match the same as [$dos]+?

Yes, that's true.  It should probably be replaced with
($dos|$mac|$unix) to avoid problems when reading Mac files, since Mac
files will be read in one big slurp (no "\n" characters found).

> 2. Do you need 'g'?

Yes, for slurping Mac files.

> 3. Can anyone benchmark whether s/[$dos]+$/$myPlatform/o is faster than
>    s/[$dos]+/$myPlatform/o?  It seems like it ought to be, but my efforts
>    haven't proven it.

It would not be useful if you're reading Mac files.

Hmm, in the case of xxx2yyy where the original file type is known,
perhaps we should be setting the input file separator accordingly?
That way, even Mac files will be read line-by-line.

Also, in the line that sets $^O, change "win" to "mswin" to satisfy
Darwin (Mac OS X) users.  OSX uses the Unix standard, apparently.

--Bill.

-- 
William R Ward            [EMAIL PROTECTED]          http://www.wards.net/~bill/
-----------------------------------------------------------------------------
     If you're not part of the solution, you're part of the precipitate.

Reply via email to