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

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!

Comment on Config::IniFiles Carriage Returns
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 moritz (Cardinal) on May 22, 2012 at 14:14 UTC
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://971792]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-08-30 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls