Fellow Monk(?:ey)?
Here is a diagram to start things:
---- ----
|01| |02|
| | | |
---- ----
\ /
----
|03|
| |
----
01 = custom module 1
02 = custom module 2
03 = file
-file is use-ing both of these modules.
-module 1 contains functions to open log files and return handles like so:
module 1:
our $LOG;
# the functions
file:
open_log_and_error($file_name);
# the above calls this function, imported from module 1,
# which opens the file $file_name and ties it to the
# handle $LOG
write_log('stuff');
# the above calls this function, imported from module 1,
# which does some processing and writes to $LOG
I would like objects in file that have been derived from module 2 to be able to use write_log, but they cannot because it is not use-ing module 1. Morever, if I did use module 1 in module 2, $LOG is already open and used by module 1. Is there any way module 2 can latch onto that and run this function?
I feel so use-d.
How do you folks handle something like this, when many files and modules and whatnottery all need to share file handles?
Thank you :)
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.