Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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


In reply to Re^2: Splitting program into modules by lis128
in thread Splitting program into modules by lis128

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-28 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found