Multiple errors/bugs in phpMyAdmin 2.11.6 script installation and use ? Full analysis and solution!

The following is for:
# Server version: 5.0.32-Debian_7etch5-log
# Protocol version: 10
# Server: Localhost via UNIX socket
phpMyAdmin - 2.11.6
MySQL client version: 5.0.32

I have created a new database for a domain with the name :
mydomain_gr_main
which appears correctly under the left panel Edit Databases.

Under this domain the phpmyadmin script is then installed (2.11.6 latest version) and configured to manage only the above database.
[Note: under the html source the databases are listed correctly:

mydomain_gr_roundcube (mysql)
mydomain_gr_main (mysql)

]

1st Bug: After some investigation I figured that the script installation adds the following line
config.inc.php:$cfg['Servers'][$i]['only_db'] = 'gr_main';
which is used then by phpmyadmin to execute the sql query
SHOW DATABASES LIKE 'gr_main'
which of course returns NO RESULTS because there are no metacharacters present for example the correct would be:
config.inc.php:$cfg['Servers'][$i]['only_db'] = '%gr_main';
OR the whole database name (Why is it truncated in the first place???)

2nd Bug: Now if you select 'install scripts' under this domain, then the phpmyadmin line shows:
Script Version Install path Using database Status Your rating
phpMyAdmin 2.11.6 (Latest) /phpmyadmin gr_main Latest
RoundCube 0.1.1 /roundcube MySQL mydomain_gr_roundcube Latest

As we can see the first database appears truncated. Strangely enough the second (the one used in roundcube) is correct!!!
Now if you click on the truncated db name gr_main the following is returned:
----------------------------------------------------------
Database details
HTTP/1.0 500 Perl execution failed Server: MiniServ/0.01 Date: Sat, 14 Jun 2008 11:15:38 GMT Content-type: text/html Connection: close
Error - Perl execution failed

Undefined subroutine &virtual_server::mydomain_size called at /usr/share/webmin/virtual-server/edit_database.cgi line 62.

Database name gr_main
Database server type
-----------------------------------------------------------
Which of course is not good!!!

I guess the problem must be on the line:
local @dbs = map { my ($dbtype, $dbname) = split(/_/, $_, 2); $dbname }
split(/\s+/, $opts->{'db'});
of phpmyadmin.pl script, which does not seem to do what it was intended...for example why does it split on _ boundary ?

3d Bug(?):
Inside the same script

local $dbs = join(" ", @dbs);
and then later:
if ($l =~ /^\$cfg\['Servers'\]\[\$i\]\['only_db'\]/) {
$l = "\$cfg['Servers'][\$i]['only_db'] = '$dbs';";
}
But according to the phpmyadmin manual for multiple databases this must be:
array('db1', 'db2') and not just ('db1', 'db2') etc...

Please check and advise.

Status: 
Closed (fixed)