Matt S Trout > Rakudo-Star > rakudo-star/parrot/config/gen/config_pm/config_pir.in

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

TITLE ^

config.pir - Access Parrot configuration data

SYNOPSIS ^

  .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

DESCRIPTION ^

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

AUTHOR ^

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

COPYRIGHT ^

Copyright (C) 2004-2009, Parrot Foundation.

syntax highlighting: