[perl #41870] [TODO] create config file processing library for use in pir

Skip to first unread message

Jerry Gay

Mar 16, 2007, 8:24:47 PM3/16/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Jerry Gay
# Please include the string: [perl #41870]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41870 >

i need a config file processing library for use in pir code--something
like perl's Config::IniFiles. a wrapper around JSON.pir should work
just as well. it doesn't need to be fancy, just allow me to read a
human-readable config file format into a pmc, and vice versa.


Will Coleda via RT

Mar 17, 2007, 6:44:10 PM3/17/07
to perl6-i...@perl.org
Done, but needs tests, and an example in the POD, like:

.sub main :main
load_bytecode 'Config/JSON.pbc'
.local pmc reader, writer
reader = get_global [ 'Config' ; 'JSON' ], 'ReadConfig'
writer = get_global [ 'Config' ; 'JSON' ], 'WriteConfig'

.local pmc config
config = reader('foo.json')

$P1 = new Hash
$P1['stuff'] = 'this'
$P1['other'] = 'that'

config["supplemental"] = $P1

writer(config, 'bar.json', 'compact'=>1)

Reply all
Reply to author
0 new messages