At my company the have departmentalized code... I.E. we have to talk to other department's code that we can't edit. The code that we used to use to access these was a hack job that
required the file it needed on every call to the FCGI. This is terribly inefficient, so we fixed it. however...
The .pl files we were requiring are all in the main:: scope, and there are function names that collide, creating havoc. I would like to force each .pl into it's own namespace, and am not sure how (short of making a wrapper .pl file that declares a package).
package foo;
require './foo.pl';
package main;
was suggested, but doesn't work right, since inside the require perl drops back to the container package, main::
I think I can fix this by making an object oriented interface, but does anyone know a way to do it with the requires? Whitout making a stub file for each?
- Ant
- Some of my best work - Fish Dinner
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.