Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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

by mr_mischief (Monsignor)
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.


Update: Changed some awkward wording and fixed a tpyo.
  • Comment on Re: Quick and portable way to determine line-ending string?

Replies are listed 'Best First'.
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. ;-)


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://103283]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2018-06-24 00:02 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.