NAME
Parrot::Configure::Options::Conf::File - Options processing functionality for Parrot's configuration-file interface
SYNOPSIS
use Parrot::Configure::Options::Conf::File qw(
@valid_options
$script
%options_components
$parrot_version
$svnid
);
DESCRIPTION
This package exports five variables on demand.
%options_components
@valid_options
$script
$parrot_version
$svnid
Typically, only one of these -- %options_components
-- is directly imported by Parrot::Configure::Options for use in the case where options are supplied to Configure.pl on the command-line. But all five are, in principle, importable by other packages.
%options_components
%options_components = (
'valid_options' => \@valid_options,
'script' => $script,
'short_circuits' => \%short_circuits,
'conditionals' => \&conditional_assignments,
);
Hash with four elements keyed as follows:
valid_options
Reference to an array holding a list of options are valid when configuring Parrot via the traditional Command-Line interface. The options are documented when you call
perl Configure.pl --help
and include--ask
to request interactive configuration.script
Defaults to string 'Configure.pl', but may be overridden for testing purposes.
short_circuits
Reference to a hash with two elements:
help
Reference to subroutine
print_help
, which prints Configure.pl's help message. Since this subroutine is shared with another package, it is actually imported from Parrot::Configure::Options::Conf.version
Reference to subroutine
print_version
, which prints Configure.pl's version number. Since this subroutine is shared with another package, it is actually imported from Parrot::Configure::Options::Conf.
conditionals
Reference to a subroutine private to this package which:
Sets default values for the
debugging
andmaintainer
options under most situations.Fetches the list of configuration steps from Parrot::Configure::Step::List. When you configure with the Command-Line Interface, you use the canonical list of configuration steps provided by that package.
The subroutine takes a single argument: a reference to a hash holding elements concerned with configuration, such as the valid options.
The subroutine returns a two-argument list:
An augmented version of the hash reference passed in as an argument.
Reference to array holding list of configuration steps.
That's probably difficult to understand at first. So here is an example of how
$options_components->{conditionals}
is actually used insideParrot::Configure::Options::process_options()
.my $data; # $data is hash ref which gets assigned some key-value pairs my $steps_list_ref; ($data, $steps_list_ref) = &{ $options_components->{conditionals} }($data);
NOTES
The functionality in this package originally appeared in Configure.pl. It was transferred here and refactored by James E Keenan.
SEE ALSO
Configure.pl. Parrot::Configure::Options. Parrot::Configure::Options::Conf. Parrot::Configure::Options::Reconf. Parrot::Configure::Options::Conf::CLI.