Name

Msql::host

Synopsis

$host = $db->host;

Msql::host returns the hostname of the database server as a scalar. There is no guarantee that the function will return the canonical name of the server or even a fully qualified domain name. In fact, although not documented, it appears that Msql::host returns the same string given to the server in the Msql::connect call. This is true even to the point that Msql::host returns undef if you use the no-argument form of Msql::connect.

Example

use Msql;
my $db = Msql->connect('www.myserver.com');

my $host = $db->host;

print "You'll probably see 'www.myserver.com': $host\n";

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.