| File: | lib/Parrot/Config.pm |
| Coverage: | 100.0% |
| line | stmt | bran | cond | sub | code |
|---|---|---|---|---|---|
| 1 | # Copyright (C) 2006-2007, Parrot Foundation. | ||||
| 2 | |||||
| 3 - 23 | =head1 NAME
Parrot::Config - Parrot Configuration Data
=head1 DESCRIPTION
This file is used for parrot's configuration data. If C<perl Configure.pl>
hasn't been run yet, it dies with a message explaining that parrot needs to be
configured first. It contains the C<%PConfig> hash which is exported with the
values loaded from F<lib/Parrot/Config/Generated.pm>.
A list of valid keys can be found from running
parrot_config --dump
=head1 SYNOPSIS
use Parrot::Config;
my $has_ipv6 = $PConfig{HAS_IPV6};
=cut | ||||
| 24 | |||||
| 25 | package Parrot::Config; | ||||
| 26 | |||||
| 27 | 73 73 73 | use strict; | |||
| 28 | 73 73 73 | use warnings; | |||
| 29 | |||||
| 30 | 73 73 73 | eval 'use Parrot::Config::Generated'; | |||
| 31 | if ($@) { | ||||
| 32 | die "\nParrot::Config is unavailable until you configure parrot.\n" | ||||
| 33 | . "Please run `perl Configure.pl`.\n\n"; | ||||
| 34 | } | ||||
| 35 | |||||
| 36 | 73 73 73 | use Exporter; | |||
| 37 | |||||
| 38 | 73 73 73 | use vars qw(@ISA @EXPORT %PConfig %PConfig_Temp); | |||
| 39 | |||||
| 40 | @ISA = qw(Exporter); | ||||
| 41 | |||||
| 42 | @EXPORT = qw(%PConfig %PConfig_Temp); | ||||
| 43 | |||||
| 44 | %PConfig = %Parrot::Config::Generated::PConfig; | ||||
| 45 | %PConfig_Temp = %Parrot::Config::Generated::PConfig_Temp; | ||||
| 46 | |||||
| 47 | 1; | ||||
| 48 | |||||
| 49 | # Local Variables: | ||||
| 50 | # mode: cperl | ||||
| 51 | # cperl-indent-level: 4 | ||||
| 52 | # fill-column: 100 | ||||
| 53 | # End: | ||||
| 54 | # vim: expandtab shiftwidth=4: | ||||