#!perl

use DBI;
use MIME::Base64;

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

my $sth = $dbh->prepare('SELECT * FROM users');
$sth->execute;
while (my $row = $sth->fetchrow_hashref) {
    $dbh->prepare('UPDATE users SET password=? WHERE id=?')->execute(unpack("H*", MIME::Base64::decode($row->{password}.'=')), $row->{id});
    print "Fixed $row->{name}\n";
}
