Tiny typo in docs for DBI.parse_dsn()

Tiny typo in docs for DBI.parse_dsn()

am 20.04.2006 08:45:12 von ron

Hi Tim

Near the end of parse_dsn()'s write up, $driver_dsn should be $driver.
--
Cheers
Ron Savage, ron@savage.net.au on 20/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company

Re: Tiny typo in docs for DBI.parse_dsn()

am 20.04.2006 10:55:36 von Tim.Bunce

On Thu, Apr 20, 2006 at 04:45:12PM +1000, Ron Savage wrote:
> Hi Tim
>
> Near the end of parse_dsn()'s write up, $driver_dsn should be $driver.

Um, I don't think so:

=item C

($scheme, $driver, $attr_string, $attr_hash, $driver_dsn) = DBI->parse_dsn($dsn)
or die "Can't parse DBI DSN '$dsn'";

Breaks apart a DBI Data Source Name (DSN) and returns the individual
parts. If $dsn doesn't contain a valid DSN then parse_dsn() returns
an empty list.

$scheme is the first part of the DSN and is currently always 'dbi'.
$driver is the driver name, possibly defaulted to $ENV{DBI_DRIVER},
and may be undefined. $attr_string is the optional attribute string,
which may be undefined. If $attr_string is true then $attr_hash
is a reference to a hash containing the parsed attribute names and
=> values. $driver_dsn is the last part of the DBI DSN string.

=cut

The existence of $dsn, $driver, and $driver_dsn is a little confusing.

I've changed it to read:

=item C

($scheme, $driver, $attr_string, $attr_hash, $driver_dsn) = DBI->parse_dsn($dsn)
or die "Can't parse DBI DSN '$dsn'";

Breaks apart a DBI Data Source Name (DSN) and returns the individual
parts. If $dsn doesn't contain a valid DSN then parse_dsn() returns
an empty list.

$scheme is the first part of the DSN and is currently always 'dbi'.
$driver is the driver name, possibly defaulted to $ENV{DBI_DRIVER},
and may be undefined. $attr_string is the contents of the optional attribute
string, which may be undefined. If $attr_string is not empty then $attr_hash
is a reference to a hash containing the parsed attribute names and values.
$driver_dsn is the last part of the DBI DSN string. For example:

($scheme, $driver, $attr_string, $attr_hash, $driver_dsn)
= DBI->parse_dsn("DBI:MyDriver(RaiseError=>1):db=test;port=42" );
$scheme = 'dbi';
$driver = 'MyDriver';
$attr_string = 'RaiseError=>1';
$attr_hash = { 'RaiseError' => '1' };
$driver_dsn = 'db=test;port=42';

=cut

Thanks.

Tim.

Re: Tiny typo in docs for DBI.parse_dsn()

am 20.04.2006 11:53:48 von ron

On Thu, 20 Apr 2006 09:55:36 +0100, Tim Bunce wrote:

Hi Tim

> The existence of $dsn, $driver, and $driver_dsn is a little
> confusing.

/I/ was confused.

> I've changed it to read:

That's fine, as long as it's clear...
--
Cheers
Ron Savage, ron@savage.net.au on 20/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company