#!perl

use DBI;

my $dbh = DBI->connect('dbi:mysql:pokedex', 'perl', '');

my $sth = $dbh->prepare('SELECT id, name, combos FROM moves');
$sth->execute;
while (my $row = $sth->fetchrow_hashref) {
    $dbh->prepare('UPDATE moves SET combos=? WHERE id=?')->execute(join(',', map { $_ + 1 } split /,/, $row->{combos}), $row->{id});
    print "Fixed $row->{name}\n";
}
