Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Accessing a lexical variable of another file.

by Superfox il Volpone (Sexton)
on Sep 10, 2014 at 13:54 UTC ( [id://1100141]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1100141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-09-18 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (25 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.