Author: timbo
Date: Mon Aug  6 23:33:43 2012
New Revision: 15360

Modified:
   dbi/trunk/Changes
   dbi/trunk/DBI.pm

Log:
Corrected typo in DBI->installed_versions docs RT#78825 and polished

Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Mon Aug  6 23:33:43 2012
@@ -15,6 +15,9 @@
 
   Fixed unused variable / self-assignment compiler warnings.
 
+  Corrected typo in DBI->installed_versions docs RT#78825
+    thanks to Jan Dubois.
+
 =head2 Changes in DBI 1.622 (svn r15327) 6th June 2012
 
   Fixed lack of =encoding in non-ASCII pod docs. RT#77588

Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm    (original)
+++ dbi/trunk/DBI.pm    Mon Aug  6 23:33:43 2012
@@ -1017,9 +1017,7 @@
 sub installed_versions {
     my ($class, $quiet) = @_;
     my %error;
-    my %version = ( DBI => $DBI::VERSION );
-    $version{"DBI::PurePerl"} = $DBI::PurePerl::VERSION
-       if $DBI::PurePerl;
+    my %version;
     for my $driver ($class->available_drivers($quiet)) {
        next if $DBI::PurePerl && grep { -d "$_/auto/DBD/$driver" } @INC;
        my $drh = eval {
@@ -1034,6 +1032,8 @@
     if (wantarray) {
        return map { m/^DBD::(\w+)/ ? ($1) : () } sort keys %version;
     }
+    $version{"DBI"}           = $DBI::VERSION;
+    $version{"DBI::PurePerl"} = $DBI::PurePerl::VERSION if $DBI::PurePerl;
     if (!defined wantarray) {  # void context
        require Config;         # add more detail
        $version{OS}   = "$^O\t($Config::Config{osvers})";
@@ -2855,7 +2855,7 @@
 
   DBI->installed_versions;
   @ary  = DBI->installed_versions;
-  %hash = DBI->installed_versions;
+  $hash = DBI->installed_versions;
 
 Calls available_drivers() and attempts to load each of them in turn
 using install_driver().  For each load that succeeds the driver
@@ -2865,12 +2865,12 @@
 When called in array context the list of successfully loaded drivers
 is returned (without the 'DBD::' prefix).
 
-When called in scalar context a reference to the hash is returned
-and the hash will also contain other entries for the C<DBI> version,
-C<OS> name, etc.
+When called in scalar context an extra entry for the C<DBI> is added (and
+C<DBI::PurePerl> if appropriate) and a reference to the hash is returned.
 
 When called in a void context the installed_versions() method will
-print out a formatted list of the hash contents, one per line.
+print out a formatted list of the hash contents, one per line, along with some
+other information about the DBI version and OS.
 
 Due to the potentially high memory cost and unknown risks of loading
 in an unknown number of drivers that just happen to be installed

Reply via email to