Re: Tiny typo in docs for DBI.parse_dsn()
- From: Tim.Bunce@xxxxxxxxx (Tim Bunce)
- Date: Thu, 20 Apr 2006 09:55:36 +0100
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<parse_dsn>
($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<parse_dsn>
($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.
.
- Follow-Ups:
- Re: Tiny typo in docs for DBI.parse_dsn()
- From: Ron Savage
- Re: Tiny typo in docs for DBI.parse_dsn()
- References:
- Tiny typo in docs for DBI.parse_dsn()
- From: Ron Savage
- Tiny typo in docs for DBI.parse_dsn()
- Prev by Date: Re: last insert id
- Next by Date: Re: Tiny typo in docs for DBI.parse_dsn()
- Previous by thread: Tiny typo in docs for DBI.parse_dsn()
- Next by thread: Re: Tiny typo in docs for DBI.parse_dsn()
- Index(es):
Relevant Pages
|