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

Hi,
thanks for the replies.

As for the rationale, it is because I am not the maintainer of the external file and I am not supposed to modify it... although it would be helpful to access a db handle it "hides" in the file.

Kind regards,
S. Fox
  • Comment on Re^2: Accessing a lexical variable of another file.

Replies are listed 'Best First'.
Re^3: Accessing a lexical variable of another file.
by clueless newbie (Curate) on Sep 10, 2014 at 14:23 UTC

    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.

      Do you think of monkey patching connect()? :)

      Cheers Rolf

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

      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