parrotcode: Access Parrot configuration data | |
Contents | Configuration |
config.pir - Access Parrot configuration data
version 0.01
.sub _some
...
# store the config data into $P0
$P0 = _config()
# Retrieve and print a key
$P1 = $P0["cc"]
print "Your C compiler is "
print $P1
print "\n"
...
.end
.include "library/config.pir"
config.pir is a mechanism for accessing most of the data collected by Configure. It's roughly equivalent to Perl5's Config.pm
module.
At the end of a successful make
of Parrot, a PASM file generated by Configure is run to put a file, config.fpmc, into the library with a frozen Hash of the configuration data. This library provides a function, _config
, to unpack and return that file's data.
_config
does not take any parameters. It returns a single Hash containing the data. Keys that were undef
in Configure contain a None
PMC; otherwise they contain a String
.
Note that the behavior of that hash when writing to any value (especially undefined values) is undefined, and may be rather funky.
Brent Royal-Gordon <brent@brentdax.com> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.
Copyright (C) 2004-2006, The Perl Foundation.
|