Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Re: Re: Re: Re: Re: Source-Code Analysis?

by drewbie (Chaplain)
on May 19, 2004 at 17:41 UTC ( [id://354693]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Re: Re: Source-Code Analysis?
in thread Source-Code Analysis?

I don't think it's possible to catch it since it's never use'd, require'd, or import'ed anywhere. Here's the code from Ima::DBI (version 0.33). I just don't see a way to find the DBIx::ContextualFetch usage unless there is someway at runtime to watch %INC, et al.
sub set_db { my $class = shift; my $db_name = shift or $class->_croak("Need a db name"); $db_name =~ s/\s/_/g; my $data_source = shift or $class->_croak("Need a data source"); my $user = shift || ""; my $password = shift || ""; my $attr = shift || {}; ref $attr eq 'HASH' or $class->_croak("$attr must be a hash refere +nce"); $attr = $class->_add_default_attributes($attr); $class->_remember_handle($db_name); no strict 'refs'; *{ $class . "::db_$db_name" } = $class->_mk_db_closure($data_source, $user, $password, $attr); return 1; } sub _add_default_attributes { my ($class, $user_attr) = @_; my %attr = $class->_default_attributes; @attr{ keys %$user_attr } = values %$user_attr; return \%attr; } sub _default_attributes { ( RaiseError => 1, AutoCommit => 0, PrintError => 0, Taint => 1, RootClass => "DBIx::ContextualFetch" ); }

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: Re: Source-Code Analysis?
by rjray (Chaplain) on May 19, 2004 at 22:27 UTC

    Well, Devel::Modlist walks along %INC in an END block, so it should pick up any modules loaded as such.

    Just a thought, but I don't know whether "do 'file.pl';" updates %INC or not. Probably, and more than likely it's not being used in this case, anyway.

    --rjray

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://354693]
help
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-29 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found