On Mon, Mar 31, 2003 at 09:44:37AM -0500, Jefferies, Brian wrote:
> Why does this example work...
> 
>       $dbh = DBI->connect("DBI:mysql:database=$database:host=$hostname",
> $user, $password) 
> 
> ...but this doesn't...
> 
>       $connect_string = qq("DBI:mysql:database=$database:host=$hostname",
> $user, $password);
>       $dbh = DBI->connect($connect_string) 

With the qq() you don't need the quotes.  In the first example, the
string you are passing is

  DBI:mysql:database=$database:host=$hostname

(with variable substitution), in the second example the string is

  "DBI:mysql:database=$database:host=$hostname"

(with variable substitution), note the quotes.  qq() is equivalent to
"".

dd
-- 
David Dooling

Reply via email to