Question: I installed libsql-translator-perl on Ubuntu 15.04 and ran it with

```
sqlt -f SQLite -t MySql /tmp/test.sql /tmp/out.sql

```

test.sql contains only this:

```
CREATE TABLE X (id INTEGER);

```

It failed with

```
Use of uninitialized value $name in pattern match (m//) at /usr/share/perl5/SQL/Translator.pm line 610.

```

I looked at this file, it contains

```
sub load {
    my $name = shift;
    my @path;
    push @path, "" if $name =~ /::/; # error here

```

The call stack shows that it was called with

```
SQL::Translator::load(undef, 'SQL::Translator::Producer')

```

from here

```
sub _load_sub {
    my ($tool, @path) = @_;

    my (undef,$module,$func_name) = $tool =~ m/((.*)::)?(\w+)$/;
    if ( my $module = load($module => @path) ) {                    # <<<<<<<
        my $sub = "$module\::$func_name";
        return wantarray ? ( \&{ $sub }, $sub ) : \&$sub;
    }
    return undef;
}

```

I don't know enough Perl to unpick this any further. Does anyone know what might be going on? Thanks.

Answer: 
The error message tells you that `$name` is undefined; it is set to the first argument, i.e. the value of `$module` in `_load_sub`, which is set to the second captured match in `m/((.*)::)?(\w+)$/`: everything in the value of `$tool` before the first occurrence of `::`, if `::` occurs, and undefined otherwise.

So `$tool` does not contain the string `::`; the matching pattern accounts for this (by including the `?` metacharacter), but the code in `load` doesn't. Looks like a bug in the code. [The documentation](http://search.cpan.org/~ilmari/SQL-Translator-0.11021/lib/SQL/Translator.pm) lists several ways to report this or verify whether this has been reported or fixed before.

You can debug Perl code by running it with `perl -d` - see [its manual](http://perldoc.perl.org/perldebug.html).
The SQL::Translator parser for MySQL is called "MySQL", not "MySql". 

```
sqlt -f SQLite -t MySQL /tmp/test.sql /tmp/out.sql

```

Running `sqlt -l` will give you a complete list of the parsers available.

But I certainly agree that the error message could be better. It's worth raising a bug against this.