Name
func()
Synopsis
$handle->func(@arguments,function_name)
This function calls private nonportable and nonstandard
methods for handles. The name of the function is given as the last
argument. Any arguments for the function specified are given first.
You can give certain private built-in functions:
_ListDBs with the hostname and optionally the port
as the first parameter (use data_sources()
instead); _ListTables
(deprecated; use tables() instead);
_CreateDB with the database name as the first
parameter; and _DropDB with the database name as
the first parameter. Here is an example:
...
my @tables = $dbh->func('_ListTables');
foreach my $table(@tables) {
print $table, "\n";
}As this syntax indicates, you can create your own private DBI functions with this method. It’s not well supported in MySQL, though.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access