#!/usr/bin/perl use strict; use warnings; use DBI; use Data::Dumper; my $dsn = "DBI:mysql:database=mysql;host=localhost;port=3306"; my $dbh = DBI->connect($dsn, 'root', '') or die "can't connect to database!"; my $ref = $dbh->selectall_arrayref("SHOW TABLES"); print Dumper $ref; $dbh->disconnect;