Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
go ahead... be a heretic
 
PerlMonks  

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

by mr_mischief (Prior)
on Aug 09, 2001 at 03:27 UTC ( #103283=note: print w/ replies, xml ) Need Help??


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

You hit on a good way to do it in your original post. Pre-populating a hash is effective and fairly simple, even if it is a bit messy. By putting it in a module and putting that on CPAN, the whole Perl community can help with submissions on what their strange systems use for line endings. It might be a little bit of overkill to use a module computationally, but this situation is more data intensive than computationally intensive. Data gathering is always done best by the experts in the particular areas (in this case, differing platforms), with the results being reported to a central repository or person. CPAN or some other joint project system is ideal for this kind of task.

Chris

Update: Changed some awkward wording and fixed a tpyo.


Comment on Re: Quick and portable way to determine line-ending string?
Re: Re: Quick and portable way to determine line-ending string?
by John M. Dlugosz (Monsignor) on Aug 09, 2001 at 07:19 UTC
    Hmm, maybe that can be part of the Config module? See $Config{trnl} which may already be what we want. Hmm, but mine shows "\\012" (literal backslash) on a Windows system, so maybe it's not actually used.
      I get the same on Windows (Win98 SE, Perl 5.6.0 ActiveState build 623). I get q{\n} on Linux with 5.6.0 though. However, if it's not dependable, then it certainly can't be used in this sort of case. Perhaps this is something p5p could go over. If I think of it, I'll send an email in the morning. I can't think how to word it right now. ;-)

      Chris

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://103283]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-04-18 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (461 votes), past polls