Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Config::IniFiles Carriage Returns

by benztronics (Initiate)
on May 22, 2012 at 13:33 UTC ( #971792=perlquestion: print w/replies, xml ) Need Help??
benztronics has asked for the wisdom of the Perl Monks concerning the following question:

Hi all! I've been using Config::IniFiles for a scheduler (amongst other handy apps) very successfully over the past few months. I just moved it to a Windows Server 2008 box and it seems to be writing the config without carriage returns in windows. Opening in Vim, it's fine, but my users, unfortunately, want to use notepad. Vim shows that it's creating a UNIX file. After a little research, It looks like if it's created in windows, it should write the proper return. I checked the $^O variable and it shows MSWin32... so I'm not sure what I need to do. It has worked properly in all of the windows XP and server 2003 environments that I have used so far. Is there a way to forcefully set the filetype? I am using Strawberry perl with the the latest CPAN installation of Config::IniFiles. Any guidance would be very helpful, thanks!

Replies are listed 'Best First'.
Re: Config::IniFiles Carriage Returns
by moritz (Cardinal) on May 22, 2012 at 14:14 UTC
Re: Config::IniFiles Carriage Returns
by Neighbour (Friar) on May 22, 2012 at 13:44 UTC
    Try setting $\ = "\r\n"; ($OUTPUT_RECORD_SEPARATOR for those who use english;) before writing out the ini-files. Windows just *loves* its CRLFs :)
    I'm not sure if Config::IniFiles respects this variable, but it's worth an attempt.
Re: Config::IniFiles Carriage Returns
by Anonymous Monk on May 23, 2012 at 00:06 UTC
Re: Config::IniFiles Carriage Returns
by benztronics (Initiate) on May 25, 2012 at 13:20 UTC
    I ended up contacting the owner... a very nice guy named Shlomi who worked with me and it turned out to be a bug. he put the corrected version (2.75) on CPAN and all is well. Thanks!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://971792]
Front-paged by Corion
[marto]: time for coffee

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-05-21 08:10 GMT
Find Nodes?
    Voting Booth?