Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Is there a variable in which Perl stores the native file delimiter for the platform on which your script is running?

by jmcnamara (Monsignor)
on Dec 23, 2005 at 01:34 UTC ( [id://518679]=note: print w/replies, xml ) Need Help??


in reply to Is there a variable in which Perl stores the native file delimiter for the platform on which your script is running?


I don't think that there is any variable or core module that you can query to get this information. You could check $^O (see perlvar) or Config to get the OS name and work it out from there. However, it might not be easy to produce a foolproof solution with this method.

As a workaround I'd suggest writing "\n" to a temp file, binmoding the file and reading back in the character(s) used as line endings.

--
John.

  • Comment on Re: Is there a variable in which Perl stores the native file delimiter for the platform on which your script is running?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2025-04-25 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.