From: Nigel Metheringham Date: Thu, 26 Jan 2006 13:57:34 +0000 (+0000) Subject: Fixed warning undefined variable in regexp caused by [705] X-Git-Tag: v0.05005~105 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5e65c3582e5784a6471de0c03bc2f3e6b92ffa4b;p=dbsrgits%2FDBIx-Class.git Fixed warning undefined variable in regexp caused by [705] --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 9b04706..37547d2 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -145,7 +145,8 @@ sub new { my $new = bless({}, ref $_[0] || $_[0]); $new->cursor("DBIx::Class::Storage::DBI::Cursor"); $new->transaction_depth(0); - if ($ENV{DBIX_CLASS_STORAGE_DBI_DEBUG} =~ /=(.+)$/) { + if (defined($ENV{DBIX_CLASS_STORAGE_DBI_DEBUG}) && + ($ENV{DBIX_CLASS_STORAGE_DBI_DEBUG} =~ /=(.+)$/)) { $new->debugfh(IO::File->new($1, 'w')||die "Cannot open trace file $1"); } else { $new->debugfh(IO::File->new('>&STDERR'));