#!/usr/bin/perl -w use strict; use vars '$dbh'; # In Perl >= 5.6.0: # our $dbh; BEGIN { $dbh = DBI->connect($DNS, "login", "password"); }