[Chicago-talk] logging in and out files

Alexander Danel danel at speakeasy.net
Tue Oct 26 10:59:37 PDT 2010



Given what you are trying to do, I suppose you want to force export somehow.
(In other words, I assume you have many program files that you want to just
add one line "use MyLogs;" and be done, and not have to add the aliasing
line into each individual code file.) You might try the following, which is
probably a little controversial, but might suit your purposes. 


In the module file "MyLog.pm", try ending it with a reset to "pachage main",
and then do the export (or "alias") operation.  So the module file would end
like this:


# . . . ending of "MyLog.pm" module forces export.


package main;


# Alias

*open = \&myLog::open;




Any comments about this idea are welcomed.


Alexander Danel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20101026/16a10581/attachment.html>

More information about the Chicago-talk mailing list