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

Re^2: Qualified package variable access

by tobyink (Canon)
on Dec 17, 2020 at 22:03 UTC ( [id://11125372]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package ECClib;
    
    ...
    sub get_dbh {
      $dbh ||= db_connect( $dbuser, $dbpasswd, $dbserver );
    }
    
  2. or download this
    use ECClib;
    
    ...
      my $dbh = ECClib->get_dbh;  # gets the same instance!
      ...;
    }
    
  3. or download this
    package ECClib;
    use v5.10;
    ...
    sub get_dbh {
      state $dbh = db_connect( $dbuser, $dbpasswd, $dbserver );
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found