TITLE ^

config.imc - Access Parrot configuration data

VERSION ^

version 0.01

SYNOPSIS ^

  .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.imc"

DESCRIPTION ^

config.imc is a mechanism for accessing most of the data collected by Configure. It's roughly equivalent to Perl'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 PerlHash 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 PerlHash containing the data. Keys that were undef in Configure contain a PerlUndef PMC; otherwise they contain a PerlString.

Note that the behavior of that hash when writing to any value (especially undefined values) is undefined, and may be rather funky.

AUTHOR ^

Brent Royal-Gordon <brent@brentdax.com> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.

COPYRIGHT ^

Copyright (c) 2004, the Perl Foundation.


parrot