Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Too many arguments to connect-help?

by erix (Vicar)
on May 28, 2014 at 06:12 UTC ( #1087610=note: print w/ replies, xml ) Need Help??


in reply to Re: Too many arguments to connect-help?
in thread Too many arguments to connect-help?

DBD::mysql [...]

it does not document if "dbi" in lower-case will be accepted.

A DBD driver only prescribes the dsn-part after 'dbi:drivername:', and the DBI docs do document it; in fact, it actually does not document that uppercase DBI is accepted :-)

DBI connect

It says:

The $data_source value must begin with "dbi:driver_name:". The driver_name specifies the driver that will be used to make the connection. (Letter case is significant.)
update: (@NetWallah's below reply), yes I quite agree.


Comment on Re^2: Too many arguments to connect-help?
Download Code
Re^3: Too many arguments to connect-help?
by NetWallah (Abbot) on May 28, 2014 at 21:32 UTC
    So - the documented examples between the DBD and DBI modules conflict.

    However, the code in DBI.pm resolves this conflict - it says:

    sub connect { .... # extract dbi:driver prefix from $dsn into $1 $dsn =~ s/^dbi:(\w*?)(?:\((.*?)\))?://i or '' =~ /()/; # ensure $1 etc are empty if match fails
    so - it will accept EITHER case for the "DBI" part.

    The part about "(Letter case is significant.)" applies to the DBD driver name, not the the "DBI" or "dbi" - it will even accept "DbI".

            What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
                  -Larry Wall, 1992

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1087610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-11-26 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (172 votes), past polls