------------ REQUIRE TAGS ------------ ---------- TAG FORMAT ---------- Where "Mod" represents the PTM/Perl module you wish to require (include): ----------- DESCRIPTION ----------- The REQUIRE tag is very different in usage from all of the other PTM tag types. REQUIRE is used as a port of Perl's "require" statement, which is used to import Perl modules at run-time. In Perl, the "use" statement is used to include modules at compile-time while "require" is used to include them at run-time. Because everything in PTM is evaluated at run-time, there is no need for Perl's "use" statement at any time. However, developers often need to include other Perl files into their Perl scripts, be it a predefined Perl library or just a custom function file. The REQUIRE tag was created because PREPROCESS tags run independent of the rest of your PTM scripts. As a developer, you dont want to have to include a module into your script twice, as it adds to processing overhead and eliminates variables that were modified in the included code the first time. The REQUIRE tag is processed at a higher lexical scope than the rest of the PTM tags, and is the very FIRST thing processed every time a PTM script is run, even before the PREPROCESS tags. This ensures that your required files are included in both the PREPROCESS and standard PTM tags. The contents of each REQUIRE tag are parsed using Perl's qw() functionality, which seperates its contents into an array based on white space (spaces, tabs, new lines, etc.). Because of this, module names do not need to be quoted, but cannot contain white space in their file names. Like Perl's "require" statement, If no file extension is given, an extension of ".pm" is assumed. If you wish to require a file of a different type, the extension must be added. Extensionless files are not accepted. Multiple files may be required at the same time with the REQUIRE tag by placing white space between their names. Files may be REQUIRED from any of the directories included in Perl's @INC path list, or from the same directory in which the PPA (PTM Parser Application) [ptm.cgi] file is stored. -------------- USAGE EXAMPLES -------------- ------------------------------------------------------------------------- Example 1: Adding Database Functionality with the PTMDB [PTMDB.pm] Module ------------------------------------------------------------------------- ------------------------------------------------------------------ Example 2: Including a File with a File Extension Other than ".pm" ------------------------------------------------------------------ ------------------------------------------------------ Example 3: Including Multiple Modules at the Same Time ------------------------------------------------------