Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Re: Quick and portable way to determine line-ending string?

by bikeNomad (Priest)
on Aug 09, 2001 at 03:03 UTC ( #103276=note: print w/replies, xml ) Need Help??

in reply to Re: Quick and portable way to determine line-ending string?
in thread Quick and portable way to determine line-ending string?

I mentioned doing what you suggest in my original post.

I had thought about IO::Scalar, but it no-op's binmode(). So you can't use that.

I believe the translation only happens on real physical disk files (I don't know about pipes, but there's no guarantee that a given platform will have pipes available).

I'd prefer to stay away from having to write to files, because many of A::Z's users are using it in web servers; writing to a file requires knowing where a temp file can be made, and might slow things down.

  • Comment on Re: Re: Quick and portable way to determine line-ending string?

Replies are listed 'Best First'.
Re: Re: Re: Quick and portable way to determine line-ending string?
by John M. Dlugosz (Monsignor) on Aug 09, 2001 at 03:11 UTC
    I'm pretty sure it will have effect any time the underlying system's file IO is used, whether it's a real file or whatever.

    As for slowing things down, does the line ending ever change? Figure it out once, and remember it. You could even make that part of installation.

    Here is another idea. You can have a known file containing the line ending candidate and just read it. See which one was transformed into a simple "\n".

    So, open (without binmode) lineend_mac and read it; ditto for lineend_pc and see which was a "\n". Neither really contained just a "\n".


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://103276]
[marto]: Wolfsbane , now I'm having flashbacks
[choroba]: Isn't Using PerlPod Creatively rather a meditation?
[choroba]: I don't see a question
[1nickt]: ugh, I stuck my head in the bass bin for 30 seconds on a dare at Ted Nugent at Hammersmith Odeon. Yes, I am 40% deaf now.
[johngg]: My daughter is incredibly jealous of my wife who got to see The Clash at Brixton many years ago. They went to see The Vaccines there recently.
[1nickt]: But the bands are even louder! I saw Spearhead (Michael Franti) at an outdoor show and had to walk a mile away to not feel pain in my chest! Babies were crying ... I asked the sound engineer why it was necessary to have the bass so loud and he laughed...
[Discipulus]: but the best i attended live was Mano Negra Patchanka at Forte Prenestino .. in 1990
[Corion]: Hmmm - Mano Negra or at least Manu Chao seem to put on a good live show. At least the one live CD I have from Manu Chao sounds good ;)
Discipulus feels the same jealousity of the johngg's daughter

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2017-03-24 12:15 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (301 votes). Check out past polls.