Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Appconfig module question

by poj (Abbot)
on Dec 15, 2017 at 17:07 UTC ( [id://1205605]=note: print w/replies, xml ) Need Help??


in reply to Appconfig module question

As Toolic suggested, pre-processing the file works

#!/usr/bin/perl use strict; use AppConfig qw(:expand); use Data::Dump 'pp'; my $config = AppConfig->new({ CASE => 1, GLOBAL => {EXPAND => EXPAND_ALL} }); $config->define("VAR=s"); $config->define("AMB=s"); $config->define("DIRSKE=s"); $config->define("SCRIPT=s"); open my $fh,'<','./file.conf' or die "$!"; my $file = do{ local $/; <$fh> }; $file =~ s/[{}]//g; close $fh; open FH,'<',\$file; $config->file(\*FH); pp $config->{'FILE'}{'STATE'}{'VARIABLE'};;
poj

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-23 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found