config.pir - Access Parrot configuration data
.sub _some ... load_bytecode 'config.pbc' # store the config data into $P0 $P0 = _config() # Retrieve and print a key $S1 = $P0["cc"] print "Your C compiler is " print $S1 print "\n" ... .end
config.pir is a mechanism for accessing most of the data collected by Configure. It's roughly equivalent to Perl5's
At the end of a successful
make of Parrot, a PIR 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 null string; otherwise they contain a non-null, possibly empty, 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 <email@example.com> is the author and maintainer. Please send patches and suggestions to the Parrot porters mailing list.
Copyright (C) 2004-2009, Parrot Foundation.