I must say that feedback overgrown my expectations.
Thank you all for humongous repository of things to read- i really appreciate that
I just wanted to say that i did not abandoned topic and will try to dig through your advices and links.
In meantime, i've managed to isolate similiar functionalities without switching namespaces. I just got rid of package statements and usage of Exporter module, but this leads to another problem
As i wrote earlier i am using my own simple debugging routines (yes i know it can be done better, but i am developing these modules giving them required functionality). Let's code speak for himself
my $debug = $ENV{'dbg'};
sub debugInfo {
my $iWasAt= ( caller(1) )[3] || "main";
my $lineWhereCalled= ( caller(0) )[2] || ( caller(1) )[2];
print STDERR ("\033[1;31m\t$iWasAt\033[0m\@\033[1;32m$lineWhereCal
+led:\033[0m \t\t@_\n") if ($debug);
}
Until now everything went fine, i called
debugInfo("entry: @_"); and i received package name with corresponding line where call was made, like
main@139: wchodze w loopa, iteracja:4
Database::sql_connect@144: entry:
API::base@13: entry: config
Now, my simple use'ing packages not being packages makes my $iWasAt always being main, also lines are relative to module file line number.
So i am looking for another solution, but i feel that with you hackers, nothing's impossible :)
Going do read thoroughly through your posts, thanks angain
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.