in reply to Re^2: Accessing a lexical variable of another file.
in thread Accessing a lexical variable of another file.

So your external file has something like "my $dbh=DBI->connect( .... );" and you want to "have a look" at $dbh?

If that's the case, you really don't care what $dbh is - what you really care about is what DBI->connect returns.

  • Comment on Re^3: Accessing a lexical variable of another file.

Replies are listed 'Best First'.
Re^4: Accessing a lexical variable of another file.
by LanX (Saint) on Sep 10, 2014 at 15:03 UTC
    Do you think of monkey patching connect()? :)

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

        Oh thanks ! Interesting module, I wasn't aware that wrapping can be done transparently to caller ...

        Always did monkey patching the old fashioned way :)

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)

Re^4: Accessing a lexical variable of another file.
by Superfox il Volpone (Sexton) on Sep 10, 2014 at 15:51 UTC
    Hi,
    thanks for the replies.

    Not sure I understood, the reference to the db handle is inside my $dbh.
    Because the file is a wrapper to the db_handle I do not want to use explicitly dbi->connect(), but I prefer to rely on the file methods to connect & disconnect. I need some additional flexibility too, and for this I would like to exploit the same handle used by the wrapper.

    Kind regards,
    S. Fox