| 1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
| 2 | .\" |
| 3 | .\" Standard preamble: |
| 4 | .\" ======================================================================== |
| 5 | .de Sh \" Subsection heading |
| 6 | .br |
| 7 | .if t .Sp |
| 8 | .ne 5 |
| 9 | .PP |
| 10 | \fB\\$1\fR |
| 11 | .PP |
| 12 | .. |
| 13 | .de Sp \" Vertical space (when we can't use .PP) |
| 14 | .if t .sp .5v |
| 15 | .if n .sp |
| 16 | .. |
| 17 | .de Vb \" Begin verbatim text |
| 18 | .ft CW |
| 19 | .nf |
| 20 | .ne \\$1 |
| 21 | .. |
| 22 | .de Ve \" End verbatim text |
| 23 | .ft R |
| 24 | .fi |
| 25 | .. |
| 26 | .\" Set up some character translations and predefined strings. \*(-- will |
| 27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| 28 | .\" double quote, and \*(R" will give a right double quote. | will give a |
| 29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
| 30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
| 31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
| 32 | .tr \(*W-|\(bv\*(Tr |
| 33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| 34 | .ie n \{\ |
| 35 | . ds -- \(*W- |
| 36 | . ds PI pi |
| 37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| 38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| 39 | . ds L" "" |
| 40 | . ds R" "" |
| 41 | . ds C` "" |
| 42 | . ds C' "" |
| 43 | 'br\} |
| 44 | .el\{\ |
| 45 | . ds -- \|\(em\| |
| 46 | . ds PI \(*p |
| 47 | . ds L" `` |
| 48 | . ds R" '' |
| 49 | 'br\} |
| 50 | .\" |
| 51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
| 52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| 53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
| 54 | .\" output yourself in some meaningful fashion. |
| 55 | .if \nF \{\ |
| 56 | . de IX |
| 57 | . tm Index:\\$1\t\\n%\t"\\$2" |
| 58 | .. |
| 59 | . nr % 0 |
| 60 | . rr F |
| 61 | .\} |
| 62 | .\" |
| 63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 64 | .\" way too many mistakes in technical documents. |
| 65 | .hy 0 |
| 66 | .if n .na |
| 67 | .\" |
| 68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| 69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
| 70 | . \" fudge factors for nroff and troff |
| 71 | .if n \{\ |
| 72 | . ds #H 0 |
| 73 | . ds #V .8m |
| 74 | . ds #F .3m |
| 75 | . ds #[ \f1 |
| 76 | . ds #] \fP |
| 77 | .\} |
| 78 | .if t \{\ |
| 79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| 80 | . ds #V .6m |
| 81 | . ds #F 0 |
| 82 | . ds #[ \& |
| 83 | . ds #] \& |
| 84 | .\} |
| 85 | . \" simple accents for nroff and troff |
| 86 | .if n \{\ |
| 87 | . ds ' \& |
| 88 | . ds ` \& |
| 89 | . ds ^ \& |
| 90 | . ds , \& |
| 91 | . ds ~ ~ |
| 92 | . ds / |
| 93 | .\} |
| 94 | .if t \{\ |
| 95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| 96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| 97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| 98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| 99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| 100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| 101 | .\} |
| 102 | . \" troff and (daisy-wheel) nroff accents |
| 103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| 104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| 105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| 106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| 107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| 108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| 109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| 110 | .ds ae a\h'-(\w'a'u*4/10)'e |
| 111 | .ds Ae A\h'-(\w'A'u*4/10)'E |
| 112 | . \" corrections for vroff |
| 113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| 114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| 115 | . \" for low resolution devices (crt and lpr) |
| 116 | .if \n(.H>23 .if \n(.V>19 \ |
| 117 | \{\ |
| 118 | . ds : e |
| 119 | . ds 8 ss |
| 120 | . ds o a |
| 121 | . ds d- d\h'-1'\(ga |
| 122 | . ds D- D\h'-1'\(hy |
| 123 | . ds th \o'bp' |
| 124 | . ds Th \o'LP' |
| 125 | . ds ae ae |
| 126 | . ds Ae AE |
| 127 | .\} |
| 128 | .rm #[ #] #H #V #F C |
| 129 | .\" ======================================================================== |
| 130 | .\" |
| 131 | .IX Title "TRELoad 3" |
| 132 | .TH TRELoad 3 "2003-04-16" "perl v5.8.0" "User Contributed Perl Documentation" |
| 133 | .SH "NAME" |
| 134 | TRELoad \- Perl extension for loading modules under TRE control |
| 135 | .SH "SYNOPSIS" |
| 136 | .IX Header "SYNOPSIS" |
| 137 | .Vb 3 |
| 138 | \& use TRELoad 'Foo' => ['abc', 'def'], |
| 139 | \& 'Bar', |
| 140 | \& 'Baz' => [ '$somevar' ]; |
| 141 | .Ve |
| 142 | .PP |
| 143 | .Vb 1 |
| 144 | \& which is the same as |
| 145 | .Ve |
| 146 | .PP |
| 147 | .Vb 3 |
| 148 | \& use Foo 'abc', 'def'; |
| 149 | \& use Bar; |
| 150 | \& use Baz '$somevar'; |
| 151 | .Ve |
| 152 | .SH "ABSTRACT" |
| 153 | .IX Header "ABSTRACT" |
| 154 | .Vb 5 |
| 155 | \& This module adds a layer of indirection between modules under |
| 156 | \& TRE control and the scripts/modules that use them. It allows |
| 157 | \& the TRE-controlled modules to be intstalled unmodified. TRELoad |
| 158 | \& emulates the Exporter, so client modules are able to import |
| 159 | \& symbols from the TRE modules. |
| 160 | .Ve |
| 161 | .SH "DESCRIPTION" |
| 162 | .IX Header "DESCRIPTION" |
| 163 | The TRELoad module exists as a layer of indirection between perl |
| 164 | modules under \s-1TRE\s0 control and scripts/modules that use them. The |
| 165 | basic idea is that we want to use \s-1TRE\s0 mechanisms to find perl modules, |
| 166 | rather than the include mechanisms built into perl. That said, we |
| 167 | want to support arbitrary perl modules and fully export the perl |
| 168 | exporter. |
| 169 | .Sh "\s-1USING\s0 A \s-1TRE\s0 \s-1MODULE\s0" |
| 170 | .IX Subsection "USING A TRE MODULE" |
| 171 | The entire usage for the TRELoad module is the 'use' line. The syntax is: |
| 172 | .PP |
| 173 | .Vb 1 |
| 174 | \& use TRELoad <list>; |
| 175 | .Ve |
| 176 | .PP |
| 177 | In its simplest (and most common) usage, the list contains the names |
| 178 | of modules to import. For instance, the \s-1TRE\s0 equivalent of: |
| 179 | .PP |
| 180 | .Vb 2 |
| 181 | \& use Foo; |
| 182 | \& use Bar; |
| 183 | .Ve |
| 184 | .PP |
| 185 | is |
| 186 | .PP |
| 187 | .Vb 1 |
| 188 | \& use TRELoad 'Foo', 'Bar'; |
| 189 | .Ve |
| 190 | .PP |
| 191 | With this syntax (i.e., no import list explicitly defined for the |
| 192 | modules), you import symbols in the default export list, just as you |
| 193 | would with the bare 'use' directives. |
| 194 | .PP |
| 195 | A normal use directive can also contain a list of symbols to import, |
| 196 | which override the default export list of the module. For instance: |
| 197 | .PP |
| 198 | .Vb 1 |
| 199 | \& use Foo 'abc', 'def'; |
| 200 | .Ve |
| 201 | .PP |
| 202 | will load the Foo module and import the symbols 'abc' and 'def' |
| 203 | instead of the default export list. The TRELoad equivalent is to use |
| 204 | an array reference immediately following the module name in the |
| 205 | TRELoad argument list. The above TRELoad equivalent would be: |
| 206 | .PP |
| 207 | .Vb 1 |
| 208 | \& use TRELoad 'Foo' => ['abc', 'def']; |
| 209 | .Ve |
| 210 | .PP |
| 211 | The perl exporter also supports tags (pseudo\-symbols starting with |
| 212 | \&':'), which are names for lists of symbols. There is a predefined tag |
| 213 | called ':DEFAULT' which contains all of the symbols in the default |
| 214 | export list. These tags are also supported by TRELoad. Therefore, |
| 215 | the following statement: |
| 216 | .PP |
| 217 | .Vb 1 |
| 218 | \& use Foo ':DEFAULT', 'abc'; |
| 219 | .Ve |
| 220 | .PP |
| 221 | has the \s-1TRE\s0 equivalent of: |
| 222 | .PP |
| 223 | .Vb 1 |
| 224 | \& use TRELoad 'Foo' => [':DEFAULT', 'abc'] |
| 225 | .Ve |
| 226 | .PP |
| 227 | which means to import all symbols in the default export list, plus the |
| 228 | symbol 'abc'. |
| 229 | .PP |
| 230 | TRELoad also supports negations, see 'perldoc Exporter' for more |
| 231 | details. As a more complicated example, consider: |
| 232 | .PP |
| 233 | .Vb 3 |
| 234 | \& use Foo 'abc'; |
| 235 | \& use Bar ':DEFAULT', 'aaa', '!bbb', '!:ccc'; |
| 236 | \& use Baz; |
| 237 | .Ve |
| 238 | .PP |
| 239 | This means, load Foo, Bar, and Baz. Import the symbol 'abc' from Foo, |
| 240 | import all the default symbols from Bar, plus 'aaa', minus the symbol |
| 241 | \&'bbb' and minus all symbols in the tag ':ccc'. Finally, import the |
| 242 | symbols in the default export list from Baz. |
| 243 | .PP |
| 244 | The \s-1TRE\s0 equivalent is: |
| 245 | .PP |
| 246 | .Vb 3 |
| 247 | \& use TRELoad 'Foo' => [ 'abc' ], |
| 248 | \& 'Bar' => [ ':DEFAULT', 'aaa', '!bbb', '!:ccc'], |
| 249 | \& 'Baz'; |
| 250 | .Ve |
| 251 | .PP |
| 252 | I assume you get the idea. |
| 253 | .Sh "\s-1OVERRIDING\s0 \s-1TRE_ENTRY\s0" |
| 254 | .IX Subsection "OVERRIDING TRE_ENTRY" |
| 255 | The TRELoad module obeys the \s-1TRE\s0 mechanism of appending tool paths to |
| 256 | \&\s-1TRE_ENTRY\s0. It is possible, however, to override the \s-1TRE_ENTRY\s0 |
| 257 | setting. To do this requires a more general syntax. Basically, |
| 258 | whereever an array reference can appear in the usage list, you may |
| 259 | substitute a hash reference. The legal keys of this hash are 'import' |
| 260 | (whose value is an array reference that is treated as an import list) |
| 261 | and 'tre_entry' (whose value is intrepreted as a string to use as a |
| 262 | value for \s-1TRE_ENTRY\s0). |
| 263 | .PP |
| 264 | For example: |
| 265 | .PP |
| 266 | .Vb 1 |
| 267 | \& use TRELoad 'Foo' => ['abc', 'def']; |
| 268 | .Ve |
| 269 | .PP |
| 270 | and |
| 271 | .PP |
| 272 | .Vb 1 |
| 273 | \& use TRELoad 'Foo' => { import => ['abc', 'def'] }; |
| 274 | .Ve |
| 275 | .PP |
| 276 | are exactly identical. |
| 277 | .PP |
| 278 | .Vb 2 |
| 279 | \& use TRELoad 'Foo' => { import => ['abc', 'def'], |
| 280 | \& tre_entry => '/SomeTool' }; |
| 281 | .Ve |
| 282 | .PP |
| 283 | is the same thing except that it will use the \s-1TRE_ENTRY\s0 of |
| 284 | \&\*(L"/SomeTool\*(R". |
| 285 | .Sh "\s-1INSTALLING\s0 A \s-1MODULE\s0" |
| 286 | .IX Subsection "INSTALLING A MODULE" |
| 287 | Modules are installed using the normal perl install mechanism. The |
| 288 | only TRE-specific step is to override the default install prefix: |
| 289 | .PP |
| 290 | .Vb 5 |
| 291 | \& make clean # if Makefile is already present |
| 292 | \& perl Makefile.PL \e |
| 293 | \& PREFIX=/import/bw/tools/release/perlmod/<module_name>/<version> |
| 294 | \& make |
| 295 | \& make install |
| 296 | .Ve |
| 297 | .PP |
| 298 | If it is a new module, you will also need to add a .tver entry for the |
| 299 | module name. |
| 300 | .Sh "\s-1EXPORT\s0" |
| 301 | .IX Subsection "EXPORT" |
| 302 | None. |
| 303 | .Sh "\s-1RESTRICTIONS\s0" |
| 304 | .IX Subsection "RESTRICTIONS" |
| 305 | There are couple of restrictions to be aware of: |
| 306 | .IP "\(bu" 4 |
| 307 | You cannot use pattern rules in an import list (i.e., import symbols |
| 308 | that begin with '/' or '!/'. There is no reason this couldn't be made |
| 309 | to work, but it's a fair amount of work and this feature is almost |
| 310 | never used. |
| 311 | .IP "\(bu" 4 |
| 312 | You can only use TRELoad on a top-level module. For instance, if a |
| 313 | module Foo contains a Foo.pm with interface code for the underlying |
| 314 | modules Foo::Bar and Foo::Baz, you must use a \*(L"use TRELoad 'Foo'\*(R", |
| 315 | since Foo::Bar and Foo::Baz will not be recognized by configsrch. If |
| 316 | you need to use those modules directly (which usually is not a good |
| 317 | idea), you can do: |
| 318 | .Sp |
| 319 | .Vb 3 |
| 320 | \& use TRELoad 'Foo'; |
| 321 | \& use Foo::Bar; |
| 322 | \& use Foo::Baz; |
| 323 | .Ve |
| 324 | .Sp |
| 325 | The TRELoad line will add the appropriate version of Foo to the |
| 326 | include path, so you can just use a regular 'use' for its sub\-modules. |
| 327 | .IP "\(bu" 4 |
| 328 | Using a number to specify a minimum version is not supported (as in: |
| 329 | \&\*(L"use Foo 3.01;\*(R") on the TRELoad 'use' line. You can get the effect, |
| 330 | however, by using: |
| 331 | .Sp |
| 332 | .Vb 2 |
| 333 | \& use TRELoad 'Foo'; |
| 334 | \& use Foo 3.01; |
| 335 | .Ve |
| 336 | .Sp |
| 337 | The TRELoad line will add the correct version of Foo to the include |
| 338 | path, so the following line will work correctly. |
| 339 | .IP "\(bu" 4 |
| 340 | Use perl-style version numbers for your \s-1TRE\s0 versions. That is to say, |
| 341 | use two decimal places after the '.'. The reason is that perl does a |
| 342 | simple \s-1ASCII\s0 comparison when it compares version numbers, so it |
| 343 | believes 1.9 to be more recent than 1.10. \s-1TRE\s0 does not care, but perl |
| 344 | does, so if users want to check the version of the module (see |
| 345 | previous bullet), this convention is required. |
| 346 | .IP "\(bu" 4 |
| 347 | You cannot load two different versions of a module in the same script. |
| 348 | For instance, suppose you had a module called Abc and another module |
| 349 | called Composite, where Composite itself used Abc. If your .tver file |
| 350 | consisted of: |
| 351 | .Sp |
| 352 | .Vb 3 |
| 353 | \& Abc / 1.01 |
| 354 | \& Abc /Composite 1.02 |
| 355 | \& Composite / 2.01 |
| 356 | .Ve |
| 357 | .Sp |
| 358 | you would be able to use Abc by itself, and you would get version |
| 359 | 1.01. You could use Composite by itself, which would get version 1.02 |
| 360 | of Abc. What you cannot do is include Abc by itself \s-1AND\s0 from within |
| 361 | Composite via something like: |
| 362 | .Sp |
| 363 | .Vb 1 |
| 364 | \& use TRELoad 'Abc', 'Composite'; |
| 365 | .Ve |
| 366 | .Sp |
| 367 | This is because it would try to load \s-1BOTH\s0 versions of 1.01 and 1.02 |
| 368 | of Abc in the same interpreter, and the names would conflict. In this |
| 369 | case, TRELoad prints a warning message to stderr and uses the first |
| 370 | version loaded of the module in question. It is impossible to make |
| 371 | this work without modifying the modules themselves, and the major |
| 372 | design goal of TRELoad was to enable the \s-1TRE\s0 use of arbitrary perl |
| 373 | modules. |
| 374 | .SH "SEE ALSO" |
| 375 | .IX Header "SEE ALSO" |
| 376 | .Vb 2 |
| 377 | \& perlmod(1), Exporter(3), |
| 378 | \& http://ppgweb.eng/cad/cheetah-cad/public/dev_env/tre_design_spec.pdf |
| 379 | .Ve |
| 380 | .SH "AUTHOR" |
| 381 | .IX Header "AUTHOR" |
| 382 | Jeff Gibson, <jeff.gibson@sun.com> |