Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Config::Properties bug?

by gregor-e (Beadle)
on Feb 03, 2003 at 17:36 UTC ( [id://232320]=perlquestion: print w/replies, xml ) Need Help??

gregor-e has asked for the wisdom of the Perl Monks concerning the following question:

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 03:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found