docs::api::ModPerl::MM



docs::api::ModPerl::MM

NAME
Synopsis
Description
"MY::" Default Methods
"WriteMakefile()" Default Arguments
Public API

NAME

ModPerl::MM −− A "subclass" of ExtUtils::MakeMaker for mod_perl 2.0

Synopsis

  use ModPerl::MM;
  # ModPerl::MM takes care of doing all the dirty job of overriding
  ModPerl::MM::WriteMakefile(...);
  # if there is a need to extend the default methods
  sub MY::constants {
      my $self = shift;
      $self−>ModPerl::MM::MY::constants;
      # do something else;
  }
  # or prevent overriding completely
  sub MY::constants { shift−>MM::constants(@_); }";
  # override the default value of WriteMakefile's attribute
  my $extra_inc = "/foo/include";
  ModPerl::MM::WriteMakefile(
      ...
      INC => $extra_inc,
      ...
  );
  # extend the default value of WriteMakefile's attribute
  my $extra_inc = "/foo/include";
  ModPerl::MM::WriteMakefile(
      ...
      INC => join " ", $extra_inc, ModPerl::MM::get_def_opt('INC'),
      ...
  );

Description

"ModPerl::MM" is a "subclass" of "ExtUtils::MakeMaker" for mod_perl 2.0, to a degree of sub-classability of "ExtUtils::MakeMaker".

When "ModPerl::MM::WriteMakefile()" is used instead of "ExtUtils::MakeMaker::WriteMakefile()", "ModPerl::MM" overrides several "ExtUtils::MakeMaker" methods behind the scenes and supplies default "WriteMakefile()" arguments adjusted for mod_perl 2.0 build. It’s written in such a way so that normally 3rd party module developers for mod_perl 2.0, don’t need to mess with Makefile.PL at all.

"MY::" Default Methods

"ModPerl::MM" overrides method foo as long as Makefile.PL hasn’t already specified a method MY::foo. If the latter happens, "ModPerl::MM" will DWIM and do nothing.

In case the functionality of "ModPerl::MM" methods needs to be extended, rather than completely overriden, the "ModPerl::MM" methods can be called internally. For example if you need to modify constants in addition to the modifications applied by "ModPerl::MM::MY::constants", call the "ModPerl::MM::MY::constants" method (notice that it resides in the package "ModPerl::MM::MY" and not "ModPerl::MM"), then do your extra manipulations on constants:

  # if there is a need to extend the methods
  sub MY::constants {
      my $self = shift;
      $self−>ModPerl::MM::MY::constants;
      # do something else;
  }

In certain cases a developers may want to prevent from "ModPerl::MM" to override certain methods. In that case an explicit override in Makefile.PL will do the job. For example if you don’t want the "constants()" method to be overriden by "ModPerl::MM", add to your Makefile.PL:

  sub MY::constants { shift−>MM::constants(@_); }";

"ModPerl::MM" overrides the following methods:

"ModPerl::MM::MY::post_initialize"
This method is deprecated.

"WriteMakefile()" Default Arguments

"ModPerl::MM::WriteMakefile" supplies default arguments such as "INC" and "TYPEMAPS" unless they weren’t passed to "ModPerl::MM::WriteMakefile" from Makefile.PL.

If the default values aren’t satisfying these should be overriden in Makefile.PL. For example to supply an empty INC , explicitly set the argument in Makefile.PL.

  ModPerl::MM::WriteMakefile(
      ...
      INC => '',
      ...
  );

If instead of fully overriding the default arguments, you want to extend or modify them, they can be retrieved using the "ModPerl::MM::get_def_opt()" function. The following example appends an extra value to the default "INC" attribute:

  my $extra_inc = "/foo/include";
  ModPerl::MM::WriteMakefile(
      ...
      INC => join " ", $extra_inc, ModPerl::MM::get_def_opt('INC'),
      ...
  );

"ModPerl::MM" supplies default values for the following "ModPerl::MM::WriteMakefile" attributes:

"CCFLAGS"
"LIBS"
"INC"
"OPTIMIZE"
"LDDLFLAGS"
"TYPEMAPS"
"dynamic_lib"

"OTHERLDFLAGS"

  dynamic_lib => { OTHERLDFLAGS => ... }

"macro"
"MOD_INSTALL"

  macro => { MOD_INSTALL => ... }

makes sure that Apache−Test/ is added to @INC.

Public API

The following functions are a part of the public API . They are described elsewhere in this document.

"WriteMakefile()"

  ModPerl::MM::WriteMakefile(...);

"get_def_opt()"

  my $def_val = ModPerl::MM::get_def_opt($key);






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.