Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^3: Was a module use'd or require'd?

by Corion (Pope)
on Aug 13, 2007 at 09:57 UTC ( #632177=note: print w/replies, xml ) Need Help??

in reply to Re^2: Was a module use'd or require'd?
in thread Was a module use'd or require'd?

I guess that Anonymous Monk wants you to explore stuffing subroutines into the DB package which is magical to Perl. At a cursory glance over perldebguts I at least find DB::postponed() which is called after a file is required but before it is executed, this might or might not help you, as you are quite unclear on what you actually want to do, except "differentiate between use and require", and your current solution does not tell me how you differentiate between the two with it.

Update: Aristotle's idea of naming the module Package::CodeDumper makes it far more clear to me why you want to distinguish between use and require - you want to create code that looks "mostly" similar to the module as loaded from disk resp. as created by other means. This would be beneficial for caching of DBIx::Class or Class::DBI modules for example, and of course for debugging such dynamically created namespaces/packages.

Replies are listed 'Best First'.
Re^4: Was a module use'd or require'd?
by Ovid (Cardinal) on Aug 13, 2007 at 10:21 UTC

    What I want to do is only unclear because the context is actually in the Devel::Recreate link I posted. Basically, I want to be able to do this:

    use Devel::Recreate 'recreate'; print recreate('Some::Package');

    From there, I want it to print out what Perl thinks the loaded module looks like. It's actually very tough to do and there are plenty of cases where it seems almost impossible. However, if I can just get a partial solution, that would be helpful for debugging.


    New address of my CGI Course.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://632177]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2018-02-21 04:03 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (274 votes). Check out past polls.