I'm having a problem using Config::Properties. It appears to be eating some characters of DOS paths. Here is a test program:

#!/usr/bin/perl

use Config::Properties;
use FindBin;
use Data::Dumper;

my $location = $FindBin::Bin;
my $PROPHANDLE;
open ($PROPHANDLE, "<$location/proptest.conf") || die
    "Cannot open config file: proptest.conf";

my $properties = new Config::Properties();
$properties->load( $PROPHANDLE );

print Dumper($properties);

Here is the properties file it reads:

first_property = ALPHA is the first property
local_dir = C:\\Temp\\test
far_dir = D:\\inetpub\\wwwroot\\test
home_dir = C:\\cygwin\\home\\gbloom
last_property = OMEGA is the last property

And here is the output. Notice the munging that is occurring to the DOS paths:

$VAR1 = bless( {
                 'format' => '%s=%s',
                 'defaults' => undef,
                 'properties' => {
                                   'far_dir' => 'D:\\etpub\\\\wwwroot\\\\test',
                                   'local_dir' => 'C:\\emp\\\\test',
                                   'first_property' => 'ALPHA is the first property',
                                   'home_dir' => 'C:\\gwin\\\\home\\\\gbloom',
                                   'last_property' => 'OMEGA is the last property'
                                 },
                 'PERL_MODE' => 0
               }, 'Config::Properties' );

Is this a bug, or do I just not understand the format of property files?

I'm running:

This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2001, Larry Wall

Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com
Built 21:33:05 Jun 17 2002

ppm> query Config-Properties
Querying target 1 (ActivePerl 5.6.1.633)
  1. Config-Properties 0.40 read Java-style properties files

Thanks


In reply to Config::Properties bug? by gregor-e

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.