parameter, or both. The C parameter indicates the name to use for the new subclass, and defaults to C. The C parameter specifies Perl code to use as the body of the subclass. =item add_property [version 0.31] package 'My::Build'; use base 'Module::Build'; __PACKAGE__->add_property( 'pedantic' ); __PACKAGE__->add_property( answer => 42 ); __PACKAGE__->add_property( 'epoch', default => sub { time }, check => sub { return 1 if /^\d+$/; shift->property_error( "'$_' is not an epoch time" ); return 0; }, ); Adds a property to a Module::Build class. Properties are those attributes of a Module::Build object which can be passed to the constructor and which have accessors to get and set them. All of the core properties, such as C and C, are defined using this class method. The first argument to C is always the name of the property. The second argument can be either a default value for the property, or a list of key/value pairs. The supported keys are: =over =item C The default value. May optionally be specified as a code reference, in which case the return value from the execution of the code reference will be used. If you need the default to be a code reference, just use a code reference to return it, e.g.: default => sub { sub { ... } }, =item C A code reference that checks that a value specified for the property is valid. During the execution of the code reference, the new value will be included in the C<$_> variable. If the value is correct, the C code reference should return true. If the value is not correct, it sends an error message to C and returns false. =back When this method is called, a new property will be installed in the Module::Build class, and an accessor will be built to allow the property to be get or set on the build object. print $build->pedantic, $/; $build->pedantic(0); If the default value is a hash reference, this generates a special-case accessor method, wherein individual key/value pairs may be set or fetched: print "stuff{foo} is: ", $build->stuff( 'foo' ), $/; $build->stuff( foo => 'bar' ); print $build->stuff( 'foo' ), $/; # Outputs "bar" Of course, you can still set the entire hash reference at once, as well: $build->stuff( { foo => 'bar', baz => 'yo' } ); In either case, if a C has been specified for the property, it will be applied to the entire hash. So the check code reference should look something like: check => sub { return 1 if defined $_ && exists $_->{foo}; shift->property_error(qq{Property "stuff" needs "foo"}); return 0; }, =item property_error [version 0.31] =back =head2 METHODS =over 4 =item add_build_element($type) [version 0.26] Adds a new type of entry to the build process. Accepts a single string specifying its type-name. There must also be a method defined to process things of that type, e.g. if you add a build element called C<'foo'>, then you must also define a method called C. See also L. =item add_to_cleanup(@files) [version 0.03] You may call C<< $self->add_to_cleanup(@patterns) >> to tell C that certain files should be removed when the user performs the C action. The arguments to the method are patterns suitable for passing to Perl's C function, specified in either Unix format or the current machine's native format. It's usually convenient to use Unix format when you hard-code the filenames (e.g. in F) and the native format when the names are programmatically generated (e.g. in a testing script). I decided to provide a dynamic method of the C<$build> object, rather than just use a static list of files named in the F, because these static lists can get difficult to manage. I usually prefer to keep the responsibility for registering temporary files close to the code that creates them. =item args() [version 0.26] my $args_href = $build->args; my %args = $build->args; my $arg_value = $build->args($key); $build->args($key, $value); This method is the preferred interface for retrieving the arguments passed via command line options to F or F, minus the Module-Build specific options. When called in a scalar context with no arguments, this method returns a reference to the hash storing all of the arguments; in an array context, it returns the hash itself. When passed a single argument, it returns the value stored in the args hash for that option key. When called with two arguments, the second argument is assigned to the args hash under the key passed as the first argument. =item autosplit_file($from, $to) [version 0.28] Invokes the L module on the C<$from> file, sending the output to the C directory inside C<$to>. C<$to> is typically the C directory. =item base_dir() [version 0.14] Returns a string containing the root-level directory of this build, i.e. where the C script and the C directory can be found. This is usually the same as the current working directory, because the C script will C into this directory as soon as it begins execution. =item build_requires() [version 0.21] Returns a hash reference indicating the C prerequisites that were passed to the C method. =item can_action( $action ) Returns a reference to the method that defines C<$action>, or false otherwise. This is handy for actions defined (or maybe not!) in subclasses. [version 0.32_xx] =item cbuilder() [version 0.2809] Returns the internal ExtUtils::CBuilder object that can be used for compiling & linking C code. If no such object is available (e.g. if the system has no compiler installed) an exception will be thrown. =item check_installed_status($module, $version) [version 0.11] This method returns a hash reference indicating whether a version dependency on a certain module is satisfied. The C<$module> argument is given as a string like C<"Data::Dumper"> or C<"perl">, and the C<$version> argument can take any of the forms described in L above. This allows very fine-grained version checking. The returned hash reference has the following structure: { ok => $whether_the_dependency_is_satisfied, have => $version_already_installed, need => $version_requested, # Same as incoming $version argument message => $informative_error_message, } If no version of C<$module> is currently installed, the C value will be the string C<< "" >>. Otherwise the C value will simply be the version of the installed module. Note that this means that if C<$module> is installed but doesn't define a version number, the C value will be C - this is why we don't use C for the case when C<$module> isn't installed at all. This method may be called either as an object method (C<< $build->check_installed_status($module, $version) >>) or as a class method (C<< Module::Build->check_installed_status($module, $version) >>). =item check_installed_version($module, $version) [version 0.05] Like L, but simply returns true or false depending on whether module C<$module> satisfies the dependency C<$version>. If the check succeeds, the return value is the actual version of C<$module> installed on the system. This allows you to do the following: my $installed = $build->check_installed_version('DBI', '1.15'); if ($installed) { print "Congratulations, version $installed of DBI is installed.\n"; } else { die "Sorry, you must install DBI.\n"; } If the check fails, we return false and set C<$@> to an informative error message. If C<$version> is any non-true value (notably zero) and any version of C<$module> is installed, we return true. In this case, if C<$module> doesn't define a version, or if its version is zero, we return the special value "0 but true", which is numerically zero, but logically true. In general you might prefer to use C if you need detailed information, or this method if you just need a yes/no answer. =item compare_versions($v1, $op, $v2) [version 0.28] Compares two module versions C<$v1> and C<$v2> using the operator C<$op>, which should be one of Perl's numeric operators like C or C<< >= >> or the like. We do at least a halfway-decent job of handling versions that aren't strictly numeric, like C<0.27_02>, but exotic stuff will likely cause problems. In the future, the guts of this method might be replaced with a call out to C. =item config($key) =item config($key, $value) =item config() [deprecated] [version 0.22] With a single argument C<$key>, returns the value associated with that key in the C hash, including any changes the author or user has specified. With C<$key> and C<$value> arguments, sets the value for future callers of C. With no arguments, returns a hash reference containing all such key-value pairs. This usage is deprecated, though, because it's a resource hog and violates encapsulation. =item config_data($name) =item config_data($name => $value) [version 0.26] With a single argument, returns the value of the configuration variable C<$name>. With two arguments, sets the given configuration variable to the given value. The value may be any Perl scalar that's serializable with C. For instance, if you write a module that can use a MySQL or PostgreSQL back-end, you might create configuration variables called C and C, and set each to an array of connection parameters for C<< DBI->connect() >>. Configuration values set in this way using the Module::Build object will be available for querying during the build/test process and after installation via the generated C<...::ConfigData> module, as C<< ...::ConfigData->config($name) >>. The L and C methods represent Module::Build's main support for configuration of installed modules. See also L. =item conflicts() [version 0.21] Returns a hash reference indicating the C prerequisites that were passed to the C method. =item contains_pod($file) [deprecated] [version 0.20] [Deprecated] Please see L instead. Returns true if the given file appears to contain POD documentation. Currently this checks whether the file has a line beginning with '=pod', '=head', or '=item', but the exact semantics may change in the future. =item copy_if_modified(%parameters) [version 0.19] Takes the file in the C parameter and copies it to the file in the C parameter, or the directory in the C parameter, if the file has changed since it was last copied (or if it doesn't exist in the new location). By default the entire directory structure of C will be copied into C; an optional C parameter will copy into C without doing so. Returns the path to the destination file, or C if nothing needed to be copied. Any directories that need to be created in order to perform the copying will be automatically created. The destination file is set to read-only. If the source file has the executable bit set, then the destination file will be made executable. =item create_build_script() [version 0.05] Creates an executable script called C in the current directory that will be used to execute further user actions. This script is roughly analogous (in function, not in form) to the Makefile created by C. This method also creates some temporary data in a directory called C<_build/>. Both of these will be removed when the C action is performed. Among the files created in C<_build/> is a F<_build/prereqs> file containing the set of prerequisites for this distribution, as a hash of hashes. This file may be C-ed to obtain the authoritative set of prerequisites, which might be different from the contents of F (because F might have set them dynamically). But fancy developers take heed: do not put any fancy custom runtime code in the F<_build/prereqs> file, leave it as a static declaration containing only strings and numbers. Similarly, do not alter the structure of the internal C<< $self->{properties}{requires} >> (etc.) data members, because that's where this data comes from. =item current_action() [version 0.28] Returns the name of the currently-running action, such as "build" or "test". This action is not necessarily the action that was originally invoked by the user. For example, if the user invoked the "test" action, current_action() would initially return "test". However, action "test" depends on action "code", so current_action() will return "code" while that dependency is being executed. Once that action has completed, current_action() will again return "test". If you need to know the name of the original action invoked by the user, see L below. =item depends_on(@actions) [version 0.28] Invokes the named action or list of actions in sequence. Using this method is preferred to calling the action explicitly because it performs some internal record-keeping, and it ensures that the same action is not invoked multiple times (note: in future versions of Module::Build it's conceivable that this run-only-once mechanism will be changed to something more intelligent). Note that the name of this method is something of a misnomer; it should really be called something like C or something, but for better or worse (perhaps better!) we were still thinking in C-like dependency terms when we created this method. See also L. The main distinction between the two is that C is meant to call an action from inside another action, whereas C is meant to set the very top action in motion. =item dir_contains($first_dir, $second_dir) [version 0.28] Returns true if the first directory logically contains the second directory. This is just a convenience function because C doesn't really provide an easy way to figure this out (but C does...). =item dispatch($action, %args) [version 0.03] Invokes the build action C<$action>. Optionally, a list of options and their values can be passed in. This is equivalent to invoking an action at the command line, passing in a list of options. Custom options that have not been registered must be passed in as a hash reference in a key named "args": $build->dispatch('foo', verbose => 1, args => { my_option => 'value' }); This method is intended to be used to programmatically invoke build actions, e.g. by applications controlling Module::Build-based builds rather than by subclasses. See also L. The main distinction between the two is that C is meant to call an action from inside another action, whereas C is meant to set the very top action in motion. =item dist_dir() [version 0.28] Returns the name of the directory that will be created during the C action. The name is derived from the C and C properties. =item dist_name() [version 0.21] Returns the name of the current distribution, as passed to the C method in a C or modified C parameter. =item dist_version() [version 0.21] Returns the version of the current distribution, as determined by the C method from a C, C, or C parameter. =item do_system($cmd, @args) [version 0.21] This is a fairly simple wrapper around Perl's C built-in command. Given a command and an array of optional arguments, this method will print the command to C, and then execute it using Perl's C. It returns true or false to indicate success or failure (the opposite of how C works, but more intuitive). Note that if you supply a single argument to C, it will/may be processed by the system's shell, and any special characters will do their special things. If you supply multiple arguments, no shell will get involved and the command will be executed directly. =item extra_compiler_flags() =item extra_compiler_flags(@flags) [version 0.25] Set or retrieve the extra compiler flags. Returns an arrayref of flags. =item extra_linker_flags() =item extra_linker_flags(@flags) [version 0.25] Set or retrieve the extra linker flags. Returns an arrayref of flags. =item feature($name) =item feature($name => $value) [version 0.26] With a single argument, returns true if the given feature is set. With two arguments, sets the given feature to the given boolean value. In this context, a "feature" is any optional functionality of an installed module. For instance, if you write a module that could optionally support a MySQL or PostgreSQL backend, you might create features called C and C, and set them to true/false depending on whether the user has the proper databases installed and configured. Features set in this way using the Module::Build object will be available for querying during the build/test process and after installation via the generated C<...::ConfigData> module, as C<< ...::ConfigData->feature($name) >>. The C and C methods represent Module::Build's main support for configuration of installed modules. See also L. =item fix_shebang_line(@files) [version 0.??] Modify any "shebang" line in the specified files to use the path to the perl executable being used for the current build. Files are modified in-place. The existing shebang line must have a command that contains "C"; arguments to the command do not count. In particular, this means that the use of C<#!/usr/bin/env perl> will not be changed. For an explanation of shebang lines, see L. =item have_c_compiler() [version 0.21] Returns true if the current system seems to have a working C compiler. We currently determine this by attempting to compile a simple C source file and reporting whether the attempt was successful. =item install_base_relpaths() =item install_base_relpaths($type) =item install_base_relpaths($type => $path) [version 0.28] Set or retrieve the relative paths that are appended to C for any installable element. This is useful if you want to set the relative install path for custom build elements. With no argument, it returns a reference to a hash containing all elements and their respective values. This hash should not be modified directly; use the multiple argument below form to change values. The single argument form returns the value associated with the element C<$type>. The multiple argument form allows you to set the paths for element types. C<$value> must be a relative path using Unix-like paths. (A series of directories separated by slashes, e.g. C.) The return value is a localized path based on C<$value>. Assigning the value C to an element causes it to be removed. =item install_destination($type) [version 0.28] Returns the directory in which items of type C<$type> (e.g. C, C, C, or anything else returned by the L method) will be installed during the C action. Any settings for C, C, and C are taken into account when determining the return value. =item install_path() =item install_path($type) =item install_path($type => $path) [version 0.28] Set or retrieve paths for specific installable elements. This is useful when you want to examine any explicit install paths specified by the user on the command line, or if you want to set the install path for a specific installable element based on another attribute like C. With no argument, it returns a reference to a hash containing all elements and their respective values. This hash should not be modified directly; use the multiple argument below form to change values. The single argument form returns the value associated with the element C<$type>. The multiple argument form allows you to set the paths for element types. The supplied C<$path> should be an absolute path to install elements of C<$type>. The return value is C<$path>. Assigning the value C to an element causes it to be removed. =item install_types() [version 0.28] Returns a list of installable types that this build knows about. These types each correspond to the name of a directory in F, and the list usually includes items such as C, C, C, C
parameter specifies Perl code to use as the body of the subclass. =item add_property [version 0.31] package 'My::Build'; use base 'Module::Build'; __PACKAGE__->add_property( 'pedantic' ); __PACKAGE__->add_property( answer => 42 ); __PACKAGE__->add_property( 'epoch', default => sub { time }, check => sub { return 1 if /^\d+$/; shift->property_error( "'$_' is not an epoch time" ); return 0; }, ); Adds a property to a Module::Build class. Properties are those attributes of a Module::Build object which can be passed to the constructor and which have accessors to get and set them. All of the core properties, such as C and C, are defined using this class method. The first argument to C is always the name of the property. The second argument can be either a default value for the property, or a list of key/value pairs. The supported keys are: =over =item C The default value. May optionally be specified as a code reference, in which case the return value from the execution of the code reference will be used. If you need the default to be a code reference, just use a code reference to return it, e.g.: default => sub { sub { ... } }, =item C A code reference that checks that a value specified for the property is valid. During the execution of the code reference, the new value will be included in the C<$_> variable. If the value is correct, the C code reference should return true. If the value is not correct, it sends an error message to C and returns false. =back When this method is called, a new property will be installed in the Module::Build class, and an accessor will be built to allow the property to be get or set on the build object. print $build->pedantic, $/; $build->pedantic(0); If the default value is a hash reference, this generates a special-case accessor method, wherein individual key/value pairs may be set or fetched: print "stuff{foo} is: ", $build->stuff( 'foo' ), $/; $build->stuff( foo => 'bar' ); print $build->stuff( 'foo' ), $/; # Outputs "bar" Of course, you can still set the entire hash reference at once, as well: $build->stuff( { foo => 'bar', baz => 'yo' } ); In either case, if a C has been specified for the property, it will be applied to the entire hash. So the check code reference should look something like: check => sub { return 1 if defined $_ && exists $_->{foo}; shift->property_error(qq{Property "stuff" needs "foo"}); return 0; }, =item property_error [version 0.31] =back =head2 METHODS =over 4 =item add_build_element($type) [version 0.26] Adds a new type of entry to the build process. Accepts a single string specifying its type-name. There must also be a method defined to process things of that type, e.g. if you add a build element called C<'foo'>, then you must also define a method called C. See also L. =item add_to_cleanup(@files) [version 0.03] You may call C<< $self->add_to_cleanup(@patterns) >> to tell C that certain files should be removed when the user performs the C action. The arguments to the method are patterns suitable for passing to Perl's C function, specified in either Unix format or the current machine's native format. It's usually convenient to use Unix format when you hard-code the filenames (e.g. in F) and the native format when the names are programmatically generated (e.g. in a testing script). I decided to provide a dynamic method of the C<$build> object, rather than just use a static list of files named in the F, because these static lists can get difficult to manage. I usually prefer to keep the responsibility for registering temporary files close to the code that creates them. =item args() [version 0.26] my $args_href = $build->args; my %args = $build->args; my $arg_value = $build->args($key); $build->args($key, $value); This method is the preferred interface for retrieving the arguments passed via command line options to F or F, minus the Module-Build specific options. When called in a scalar context with no arguments, this method returns a reference to the hash storing all of the arguments; in an array context, it returns the hash itself. When passed a single argument, it returns the value stored in the args hash for that option key. When called with two arguments, the second argument is assigned to the args hash under the key passed as the first argument. =item autosplit_file($from, $to) [version 0.28] Invokes the L module on the C<$from> file, sending the output to the C directory inside C<$to>. C<$to> is typically the C directory. =item base_dir() [version 0.14] Returns a string containing the root-level directory of this build, i.e. where the C script and the C directory can be found. This is usually the same as the current working directory, because the C script will C into this directory as soon as it begins execution. =item build_requires() [version 0.21] Returns a hash reference indicating the C prerequisites that were passed to the C method. =item can_action( $action ) Returns a reference to the method that defines C<$action>, or false otherwise. This is handy for actions defined (or maybe not!) in subclasses. [version 0.32_xx] =item cbuilder() [version 0.2809] Returns the internal ExtUtils::CBuilder object that can be used for compiling & linking C code. If no such object is available (e.g. if the system has no compiler installed) an exception will be thrown. =item check_installed_status($module, $version) [version 0.11] This method returns a hash reference indicating whether a version dependency on a certain module is satisfied. The C<$module> argument is given as a string like C<"Data::Dumper"> or C<"perl">, and the C<$version> argument can take any of the forms described in L above. This allows very fine-grained version checking. The returned hash reference has the following structure: { ok => $whether_the_dependency_is_satisfied, have => $version_already_installed, need => $version_requested, # Same as incoming $version argument message => $informative_error_message, } If no version of C<$module> is currently installed, the C value will be the string C<< "" >>. Otherwise the C value will simply be the version of the installed module. Note that this means that if C<$module> is installed but doesn't define a version number, the C value will be C - this is why we don't use C for the case when C<$module> isn't installed at all. This method may be called either as an object method (C<< $build->check_installed_status($module, $version) >>) or as a class method (C<< Module::Build->check_installed_status($module, $version) >>). =item check_installed_version($module, $version) [version 0.05] Like L, but simply returns true or false depending on whether module C<$module> satisfies the dependency C<$version>. If the check succeeds, the return value is the actual version of C<$module> installed on the system. This allows you to do the following: my $installed = $build->check_installed_version('DBI', '1.15'); if ($installed) { print "Congratulations, version $installed of DBI is installed.\n"; } else { die "Sorry, you must install DBI.\n"; } If the check fails, we return false and set C<$@> to an informative error message. If C<$version> is any non-true value (notably zero) and any version of C<$module> is installed, we return true. In this case, if C<$module> doesn't define a version, or if its version is zero, we return the special value "0 but true", which is numerically zero, but logically true. In general you might prefer to use C if you need detailed information, or this method if you just need a yes/no answer. =item compare_versions($v1, $op, $v2) [version 0.28] Compares two module versions C<$v1> and C<$v2> using the operator C<$op>, which should be one of Perl's numeric operators like C or C<< >= >> or the like. We do at least a halfway-decent job of handling versions that aren't strictly numeric, like C<0.27_02>, but exotic stuff will likely cause problems. In the future, the guts of this method might be replaced with a call out to C. =item config($key) =item config($key, $value) =item config() [deprecated] [version 0.22] With a single argument C<$key>, returns the value associated with that key in the C hash, including any changes the author or user has specified. With C<$key> and C<$value> arguments, sets the value for future callers of C. With no arguments, returns a hash reference containing all such key-value pairs. This usage is deprecated, though, because it's a resource hog and violates encapsulation. =item config_data($name) =item config_data($name => $value) [version 0.26] With a single argument, returns the value of the configuration variable C<$name>. With two arguments, sets the given configuration variable to the given value. The value may be any Perl scalar that's serializable with C. For instance, if you write a module that can use a MySQL or PostgreSQL back-end, you might create configuration variables called C and C, and set each to an array of connection parameters for C<< DBI->connect() >>. Configuration values set in this way using the Module::Build object will be available for querying during the build/test process and after installation via the generated C<...::ConfigData> module, as C<< ...::ConfigData->config($name) >>. The L and C methods represent Module::Build's main support for configuration of installed modules. See also L. =item conflicts() [version 0.21] Returns a hash reference indicating the C prerequisites that were passed to the C method. =item contains_pod($file) [deprecated] [version 0.20] [Deprecated] Please see L instead. Returns true if the given file appears to contain POD documentation. Currently this checks whether the file has a line beginning with '=pod', '=head', or '=item', but the exact semantics may change in the future. =item copy_if_modified(%parameters) [version 0.19] Takes the file in the C parameter and copies it to the file in the C parameter, or the directory in the C parameter, if the file has changed since it was last copied (or if it doesn't exist in the new location). By default the entire directory structure of C will be copied into C; an optional C parameter will copy into C without doing so. Returns the path to the destination file, or C if nothing needed to be copied. Any directories that need to be created in order to perform the copying will be automatically created. The destination file is set to read-only. If the source file has the executable bit set, then the destination file will be made executable. =item create_build_script() [version 0.05] Creates an executable script called C in the current directory that will be used to execute further user actions. This script is roughly analogous (in function, not in form) to the Makefile created by C. This method also creates some temporary data in a directory called C<_build/>. Both of these will be removed when the C action is performed. Among the files created in C<_build/> is a F<_build/prereqs> file containing the set of prerequisites for this distribution, as a hash of hashes. This file may be C-ed to obtain the authoritative set of prerequisites, which might be different from the contents of F (because F might have set them dynamically). But fancy developers take heed: do not put any fancy custom runtime code in the F<_build/prereqs> file, leave it as a static declaration containing only strings and numbers. Similarly, do not alter the structure of the internal C<< $self->{properties}{requires} >> (etc.) data members, because that's where this data comes from. =item current_action() [version 0.28] Returns the name of the currently-running action, such as "build" or "test". This action is not necessarily the action that was originally invoked by the user. For example, if the user invoked the "test" action, current_action() would initially return "test". However, action "test" depends on action "code", so current_action() will return "code" while that dependency is being executed. Once that action has completed, current_action() will again return "test". If you need to know the name of the original action invoked by the user, see L below. =item depends_on(@actions) [version 0.28] Invokes the named action or list of actions in sequence. Using this method is preferred to calling the action explicitly because it performs some internal record-keeping, and it ensures that the same action is not invoked multiple times (note: in future versions of Module::Build it's conceivable that this run-only-once mechanism will be changed to something more intelligent). Note that the name of this method is something of a misnomer; it should really be called something like C or something, but for better or worse (perhaps better!) we were still thinking in C-like dependency terms when we created this method. See also L. The main distinction between the two is that C is meant to call an action from inside another action, whereas C is meant to set the very top action in motion. =item dir_contains($first_dir, $second_dir) [version 0.28] Returns true if the first directory logically contains the second directory. This is just a convenience function because C doesn't really provide an easy way to figure this out (but C does...). =item dispatch($action, %args) [version 0.03] Invokes the build action C<$action>. Optionally, a list of options and their values can be passed in. This is equivalent to invoking an action at the command line, passing in a list of options. Custom options that have not been registered must be passed in as a hash reference in a key named "args": $build->dispatch('foo', verbose => 1, args => { my_option => 'value' }); This method is intended to be used to programmatically invoke build actions, e.g. by applications controlling Module::Build-based builds rather than by subclasses. See also L. The main distinction between the two is that C is meant to call an action from inside another action, whereas C is meant to set the very top action in motion. =item dist_dir() [version 0.28] Returns the name of the directory that will be created during the C action. The name is derived from the C and C properties. =item dist_name() [version 0.21] Returns the name of the current distribution, as passed to the C method in a C or modified C parameter. =item dist_version() [version 0.21] Returns the version of the current distribution, as determined by the C method from a C, C, or C parameter. =item do_system($cmd, @args) [version 0.21] This is a fairly simple wrapper around Perl's C built-in command. Given a command and an array of optional arguments, this method will print the command to C, and then execute it using Perl's C. It returns true or false to indicate success or failure (the opposite of how C works, but more intuitive). Note that if you supply a single argument to C, it will/may be processed by the system's shell, and any special characters will do their special things. If you supply multiple arguments, no shell will get involved and the command will be executed directly. =item extra_compiler_flags() =item extra_compiler_flags(@flags) [version 0.25] Set or retrieve the extra compiler flags. Returns an arrayref of flags. =item extra_linker_flags() =item extra_linker_flags(@flags) [version 0.25] Set or retrieve the extra linker flags. Returns an arrayref of flags. =item feature($name) =item feature($name => $value) [version 0.26] With a single argument, returns true if the given feature is set. With two arguments, sets the given feature to the given boolean value. In this context, a "feature" is any optional functionality of an installed module. For instance, if you write a module that could optionally support a MySQL or PostgreSQL backend, you might create features called C and C, and set them to true/false depending on whether the user has the proper databases installed and configured. Features set in this way using the Module::Build object will be available for querying during the build/test process and after installation via the generated C<...::ConfigData> module, as C<< ...::ConfigData->feature($name) >>. The C and C methods represent Module::Build's main support for configuration of installed modules. See also L. =item fix_shebang_line(@files) [version 0.??] Modify any "shebang" line in the specified files to use the path to the perl executable being used for the current build. Files are modified in-place. The existing shebang line must have a command that contains "C"; arguments to the command do not count. In particular, this means that the use of C<#!/usr/bin/env perl> will not be changed. For an explanation of shebang lines, see L. =item have_c_compiler() [version 0.21] Returns true if the current system seems to have a working C compiler. We currently determine this by attempting to compile a simple C source file and reporting whether the attempt was successful. =item install_base_relpaths() =item install_base_relpaths($type) =item install_base_relpaths($type => $path) [version 0.28] Set or retrieve the relative paths that are appended to C for any installable element. This is useful if you want to set the relative install path for custom build elements. With no argument, it returns a reference to a hash containing all elements and their respective values. This hash should not be modified directly; use the multiple argument below form to change values. The single argument form returns the value associated with the element C<$type>. The multiple argument form allows you to set the paths for element types. C<$value> must be a relative path using Unix-like paths. (A series of directories separated by slashes, e.g. C.) The return value is a localized path based on C<$value>. Assigning the value C to an element causes it to be removed. =item install_destination($type) [version 0.28] Returns the directory in which items of type C<$type> (e.g. C, C, C, or anything else returned by the L method) will be installed during the C action. Any settings for C, C, and C are taken into account when determining the return value. =item install_path() =item install_path($type) =item install_path($type => $path) [version 0.28] Set or retrieve paths for specific installable elements. This is useful when you want to examine any explicit install paths specified by the user on the command line, or if you want to set the install path for a specific installable element based on another attribute like C. With no argument, it returns a reference to a hash containing all elements and their respective values. This hash should not be modified directly; use the multiple argument below form to change values. The single argument form returns the value associated with the element C<$type>. The multiple argument form allows you to set the paths for element types. The supplied C<$path> should be an absolute path to install elements of C<$type>. The return value is C<$path>. Assigning the value C to an element causes it to be removed. =item install_types() [version 0.28] Returns a list of installable types that this build knows about. These types each correspond to the name of a directory in F, and the list usually includes items such as C, C, C, C